<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml" lang="en">

<head>
  <link href='https://fonts.googleapis.com/css?family=Inconsolata' rel='stylesheet' type='text/css' /><title>Release Notes for MongoDB 4.2 &mdash; MongoDB Manual</title><link rel="shortcut icon" href="https://media.mongodb.org/favicon.ico" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="robots" content="index" />

  <meta name="release" content="4.2.5"/>
  <meta name="version" content="4.2"/>
  <meta name="DC.Source" content="https://github.com/mongodb/docs/blob/v4.2/source/release-notes/4.2.txt"/>
  <meta property="og:image" content="http://s3.amazonaws.com/info-mongodb-com/_com_assets/cms/mongodb-for-giant-ideas-bbab5c3cf8.png">
  <meta property="og:image:secure_url" content="https://webassets.mongodb.com/_com_assets/cms/mongodb-for-giant-ideas-bbab5c3cf8.png">
      <link rel="canonical" href="https://docs.mongodb.com/manual/release-notes/4.2" />
  
   <link rel="stylesheet" href="../_static/mongodb-docs.css" type="text/css" />
   <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
   <link rel="stylesheet" href="../_static/css/navbar.min.css" type="text/css" />
    
    <script type="text/javascript" src="../_static/lib/jquery.min.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/lib/bootstrap.js"></script>
    <script type="text/javascript" src="../_static/lib/jquery.cookie.js"></script>
    <script type="text/javascript" src="../_static/controller.js"></script>
      <link rel="search" type="application/opensearchdescription+xml" href="https://docs.mongodb.com/osd.xml" title="MongoDB Help"/>
<link rel="author" title="About these documents" href="../about.html" />
<!-- <link rel="index" title="Index" href="../genindex.html" /> -->
<link rel="search" title="Search" href="../search.html" />
<link rel="top" title="MongoDB Manual" href="../index.html" />
<link rel="up" title="Release Notes" href="../release-notes.html" />
<link rel="next" title="Compatibility Changes in MongoDB 4.2" href="4.2-compatibility.html" />
<link rel="prev" title="Release Notes" href="../release-notes.html" /><script type='text/javascript'>
   var gptadslots=[];
   var googletag = googletag || {};
   googletag.cmd = googletag.cmd || [];
   (function(){ var gads = document.createElement('script');
      gads.async = true; gads.type = 'text/javascript';
      var useSSL = 'https:' == document.location.protocol;
      gads.src = (useSSL ? 'https:' : 'http:') + '//www.googletagservices.com/tag/js/gpt.js';
      var node = document.getElementsByTagName('script')[0];
      node.parentNode.insertBefore(gads, node);
   })();
</script>

<script type="text/javascript">
   googletag.cmd.push(function() {

      var pathname = location.href;
      
      if ( (pathname.indexOf("auth") >= 0) || (pathname.indexOf("security") >= 0) ) {
         gptadslots[1]= googletag.defineSlot('/40039723/docs.mongodb.org/security', [[160,600],[243,202],[293,244]],'mongodb-docs-1').addService(googletag.pubads());
      } else if ( (pathname.indexOf("crud") >= 0) ||  (pathname.indexOf("query") >= 0) || (pathname.indexOf("insert") >= 0) || (pathname.indexOf("update") >= 0) || (pathname.indexOf("remove") >= 0) || (pathname.indexOf("delete") >= 0) || (pathname.indexOf("aggregation") >= 0) ) {
         gptadslots[1]= googletag.defineSlot('/40039723/docs.mongodb.org/crud', [[160,600],[243,202],[293,244]],'mongodb-docs-1').addService(googletag.pubads());
      } else if (pathname.indexOf("shard") >= 0) {
         gptadslots[1]= googletag.defineSlot('/40039723/docs.mongodb.org/sharding', [[160,600],[243,202],[293,244]],'mongodb-docs-1').addService(googletag.pubads());
      } else if (pathname.indexOf("replica") >= 0) {
         gptadslots[1]= googletag.defineSlot('/40039723/docs.mongodb.org/replication', [[160,600],[243,202],[293,244]],'mongodb-docs-1').addService(googletag.pubads());
      } else if (pathname.indexOf("model") >= 0) {
         gptadslots[1]= googletag.defineSlot('/40039723/docs.mongodb.org/data-modeling', [[160,600],[243,202],[293,244]],'mongodb-docs-1').addService(googletag.pubads());
      } else if (pathname.indexOf("administration") >= 0) {
         gptadslots[1]= googletag.defineSlot('/40039723/docs.mongodb.org/support', [[160,600],[243,202],[293,244]],'mongodb-docs-1').addService(googletag.pubads());
      } else if (pathname.indexOf("install-mongodb-on-windows") >= 0) {
         gptadslots[1]= googletag.defineSlot('/40039723/docs.mongodb.org/install-mongodb-on-windows', [160, 600], 'mongodb-docs-1').addService(googletag.pubads());
      } else if (pathname.indexOf("tutorial/getting-started") >= 0) {
         gptadslots[1]= googletag.defineSlot('/40039723/docs.mongodb.org/docs_server_gettingstarted', [160, 600], 'mongodb-docs-1').addService(googletag.pubads());
      } else {
         //Adslot 1 declaration
         gptadslots[1]= googletag.defineSlot('/40039723/docs.mongodb.org', [[160,600],[243,202],[293,244]],'mongodb-docs-1').addService(googletag.pubads());
      }
      googletag.pubads().enableSingleRequest();
      googletag.pubads().enableAsyncRendering();
      googletag.enableServices();
   });
</script></head>
<body data-project="manual" data-project-title="MongoDB Manual" data-branch="v4.2" data-enable-marian=1>
  <!-- Google Tag Manager -->
  <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-JQHP"
                    height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
  <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push(
     {'gtm.start': new Date().getTime(),event:'gtm.js'}
   );var f=d.getElementsByTagName(s)[0],
   j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
   '//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
   })(window,document,'script','dataLayer','GTM-JQHP');</script>
  <!-- End Google Tag Manager -->
<div id="navbar" data-navprops='{"links": [{"url": "https://docs.mongodb.com/manual/","text": "Server","active": true},{"url": "https://docs.mongodb.com/ecosystem/drivers/","text": "Drivers"},{"url": "https://docs.mongodb.com/cloud/","text": "Cloud"},{"url": "https://docs.mongodb.com/tools/","text": "Tools"},{"url": "https://docs.mongodb.com/guides/","text": "Guides"}]}'></div>
      <script>
        window.googleSearchCx = "017213726194841070573:WMX6838984"
	window.googleSearchPlaceholder = "Search Documentation"
        window.googleSearchResultsUrl = "http://docs.mongodb.com/manual/search/"
      </script>
    <script src="../_static/navbar.min.js"></script>
  

  <div class="content" >

   <div id="left-column">
         <aside id="sidebar" class="sidebar">
             
  <div class="sphinxsidebar" id="sphinxsidebar">
    <div id="sphinxsidebarwrapper" class="sphinxsidebarwrapper"><a href="javascript:void(0)" class="closeNav" id="closeNav">Close &times;</a>


<h3>
  <a class="index-link" href="../index.html">MongoDB Manual</a>
</h3>


    <div class="btn-group version-sidebar">
      <button type="button" class="version-button dropdown-toggle" data-toggle="dropdown">
        
        
        Version 4.2 (current)<span class="caret"></span>
      </button>
      <ul class="dropdown-menu" role="menu">
        
          
          <li>
          
            <a class="version-selector" href="#" data-path="master">
              
              Version 4.4 (upcoming)
            </a>
          </li>
        
          
          <li class="active">
          
            <a href="#" data-path="manual">
              
              Version 4.2 (current)
            </a>
          </li>
        
          
          <li>
          
            <a class="version-selector" href="#" data-path="v4.0">
              
              Version 4.0
            </a>
          </li>
        
          
          <li>
          
            <a class="version-selector" href="#" data-path="v3.6">
              
              Version 3.6
            </a>
          </li>
        
          
          <li>
          
            <a class="version-selector" href="#" data-path="v3.4">
              
              Version 3.4
            </a>
          </li>
        
          
          <li>
          
            <a class="version-selector" href="#" data-path="v3.2">
              
              Version 3.2
            </a>
          </li>
        
          
          <li>
          
            <a class="version-selector" href="#" data-path="v3.0">
              
              Version 3.0
            </a>
          </li>
        
          
          <li>
          
            <a class="version-selector" href="#" data-path="v2.6">
              
              Version 2.6
            </a>
          </li>
        
          
          <li>
          
            <a class="version-selector" href="#" data-path="v2.4">
              
              Version 2.4
            </a>
          </li>
        
          
          <li>
          
            <a class="version-selector" href="#" data-path="v2.2">
              
              Version 2.2
            </a>
          </li>
        
      </ul>
    </div>


<ul class="current"><li class="toctree-l1"><a class="reference internal" href="../introduction.html">Introduction</a><ul><li class="toctree-l2"><a class="reference internal" href="../tutorial/getting-started.html">Getting Started</a></li><li class="toctree-l2"><a class="reference external" href="https://docs.atlas.mongodb.com/getting-started/">Create an Atlas Free Tier Cluster</a></li><li class="toctree-l2"><a class="reference internal" href="../core/databases-and-collections.html">Databases and Collections</a><ul><li class="toctree-l3"><a class="reference internal" href="../core/views.html">Views</a></li><li class="toctree-l3"><a class="reference internal" href="../core/materialized-views.html">On-Demand Materialized Views</a></li><li class="toctree-l3"><a class="reference internal" href="../core/capped-collections.html">Capped Collections</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../core/document.html">Documents</a></li><li class="toctree-l2"><a class="reference internal" href="../reference/bson-types.html">BSON Types</a><ul><li class="toctree-l3"><a class="reference internal" href="../reference/bson-type-comparison-order.html">Comparison/Sort Order</a></li><li class="toctree-l3"><a class="reference internal" href="../reference/mongodb-extended-json.html">MongoDB Extended JSON (v2)</a></li><li class="toctree-l3"><a class="reference internal" href="../reference/mongodb-extended-json-v1.html">MongoDB Extended JSON (v1)</a></li></ul></li></ul></li><li class="toctree-l1"><a class="reference internal" href="../installation.html">Installation</a><ul><li class="toctree-l2"><a class="reference internal" href="../administration/install-community.html">Install MongoDB Community Edition</a><ul><li class="toctree-l3"><a class="reference internal" href="../administration/install-on-linux.html">Install on Linux</a><ul><li class="toctree-l4"><a class="reference internal" href="../tutorial/install-mongodb-on-red-hat.html">Install on Red Hat</a><ul><li class="toctree-l5"><a class="reference internal" href="../tutorial/install-mongodb-on-red-hat-tarball.html">Install using .tgz Tarball</a></li></ul></li><li class="toctree-l4"><a class="reference internal" href="../tutorial/install-mongodb-on-ubuntu.html">Install on Ubuntu</a><ul><li class="toctree-l5"><a class="reference internal" href="../tutorial/install-mongodb-on-ubuntu-tarball.html">Install using .tgz Tarball</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/installation-ubuntu-community-troubleshooting.html">Troubleshoot Ubuntu Installation</a></li></ul></li><li class="toctree-l4"><a class="reference internal" href="../tutorial/install-mongodb-on-debian.html">Install on Debian</a><ul><li class="toctree-l5"><a class="reference internal" href="../tutorial/install-mongodb-on-debian-tarball.html">Install using .tgz Tarball</a></li></ul></li><li class="toctree-l4"><a class="reference internal" href="../tutorial/install-mongodb-on-suse.html">Install on SUSE</a><ul><li class="toctree-l5"><a class="reference internal" href="../tutorial/install-mongodb-on-suse-tarball.html">Install using .tgz Tarball</a></li></ul></li><li class="toctree-l4"><a class="reference internal" href="../tutorial/install-mongodb-on-amazon.html">Install on Amazon</a><ul><li class="toctree-l5"><a class="reference internal" href="../tutorial/install-mongodb-on-amazon-tarball.html">Install using .tgz Tarball</a></li></ul></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/install-mongodb-on-os-x.html">Install on macOS</a><ul><li class="toctree-l4"><a class="reference internal" href="../tutorial/install-mongodb-on-os-x-tarball.html">Install using .tgz Tarball</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/install-mongodb-on-windows.html">Install on Windows</a><ul><li class="toctree-l4"><a class="reference internal" href="../tutorial/install-mongodb-on-windows-unattended.html">Install using msiexec.exe</a></li></ul></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../administration/install-enterprise.html">Install MongoDB Enterprise</a><ul><li class="toctree-l3"><a class="reference internal" href="../administration/install-enterprise-linux.html">Install on Linux</a><ul><li class="toctree-l4"><a class="reference internal" href="../tutorial/install-mongodb-enterprise-on-red-hat.html">Install on Red Hat</a><ul><li class="toctree-l5"><a class="reference internal" href="../tutorial/install-mongodb-enterprise-on-red-hat-tarball.html">Install using .tgz Tarball</a></li></ul></li><li class="toctree-l4"><a class="reference internal" href="../tutorial/install-mongodb-enterprise-on-ubuntu.html">Install on Ubuntu</a><ul><li class="toctree-l5"><a class="reference internal" href="../tutorial/install-mongodb-enterprise-on-ubuntu-tarball.html">Install using .tgz Tarball</a></li></ul></li><li class="toctree-l4"><a class="reference internal" href="../tutorial/install-mongodb-enterprise-on-debian.html">Install on Debian</a><ul><li class="toctree-l5"><a class="reference internal" href="../tutorial/install-mongodb-enterprise-on-debian-tarball.html">Install using .tgz Tarball</a></li></ul></li><li class="toctree-l4"><a class="reference internal" href="../tutorial/install-mongodb-enterprise-on-suse.html">Install on SUSE</a><ul><li class="toctree-l5"><a class="reference internal" href="../tutorial/install-mongodb-enterprise-on-suse-tarball.html">Install using .tgz Tarball</a></li></ul></li><li class="toctree-l4"><a class="reference internal" href="../tutorial/install-mongodb-enterprise-on-amazon.html">Install on Amazon</a><ul><li class="toctree-l5"><a class="reference internal" href="../tutorial/install-mongodb-enterprise-on-amazon-tarball.html">Install using .tgz Tarball</a></li></ul></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/install-mongodb-enterprise-on-os-x.html">Install on macOS</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/install-mongodb-enterprise-on-windows.html">Install on Windows</a><ul><li class="toctree-l4"><a class="reference internal" href="../tutorial/install-mongodb-enterprise-on-windows-unattended.html">Install using msiexec.exe</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/install-mongodb-enterprise-with-docker.html">Install with Docker</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../administration/upgrade-community-to-enterprise.html">Upgrade MongoDB Community to MongoDB Enterprise</a><ul><li class="toctree-l3"><a class="reference internal" href="../tutorial/upgrade-to-enterprise-standalone.html">Upgrade to MongoDB Enterprise (Standalone)</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/upgrade-to-enterprise-replica-set.html">Upgrade to MongoDB Enterprise (Replica Set)</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/upgrade-to-enterprise-sharded-cluster.html">Upgrade to MongoDB Enterprise (Sharded Cluster)</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../tutorial/verify-mongodb-packages.html">Verify Integrity of MongoDB Packages</a></li></ul></li><li class="toctree-l1"><a class="reference internal" href="../mongo.html">The <code class="docutils literal"><span class="pre">mongo</span></code> Shell</a><ul><li class="toctree-l2"><a class="reference internal" href="../tutorial/configure-mongo-shell.html">Configure the <code class="docutils literal"><span class="pre">mongo</span></code> Shell</a></li><li class="toctree-l2"><a class="reference internal" href="../tutorial/access-mongo-shell-help.html">Access the <code class="docutils literal"><span class="pre">mongo</span></code> Shell Help</a></li><li class="toctree-l2"><a class="reference internal" href="../tutorial/write-scripts-for-the-mongo-shell.html">Write Scripts for the <code class="docutils literal"><span class="pre">mongo</span></code> Shell</a></li><li class="toctree-l2"><a class="reference internal" href="../core/shell-types.html">Data Types in the <code class="docutils literal"><span class="pre">mongo</span></code> Shell</a></li><li class="toctree-l2"><a class="reference internal" href="../reference/mongo-shell.html"><code class="docutils literal"><span class="pre">mongo</span></code> Shell Quick Reference</a></li></ul></li><li class="toctree-l1"><a class="reference internal" href="../crud.html">MongoDB CRUD Operations</a><ul><li class="toctree-l2"><a class="reference internal" href="../tutorial/insert-documents.html">Insert Documents</a><ul><li class="toctree-l3"><a class="reference internal" href="../reference/insert-methods.html">Insert Methods</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../tutorial/query-documents.html">Query Documents</a><ul><li class="toctree-l3"><a class="reference internal" href="../tutorial/query-embedded-documents.html">Query on Embedded/Nested Documents</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/query-arrays.html">Query an Array</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/query-array-of-documents.html">Query an Array of Embedded Documents</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/project-fields-from-query-results.html">Project Fields to Return from Query</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/query-for-null-fields.html">Query for Null or Missing Fields</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/iterate-a-cursor.html">Iterate a Cursor in the <code class="docutils literal"><span class="pre">mongo</span></code> Shell</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../tutorial/update-documents.html">Update Documents</a><ul><li class="toctree-l3"><a class="reference internal" href="../tutorial/update-documents-with-aggregation-pipeline.html">Updates with Aggregation Pipeline</a></li><li class="toctree-l3"><a class="reference internal" href="../reference/update-methods.html">Update Methods</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../tutorial/remove-documents.html">Delete Documents</a><ul><li class="toctree-l3"><a class="reference internal" href="../reference/delete-methods.html">Delete Methods</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../core/bulk-write-operations.html">Bulk Write Operations</a></li><li class="toctree-l2"><a class="reference internal" href="../core/retryable-writes.html">Retryable Writes</a></li><li class="toctree-l2"><a class="reference internal" href="../reference/sql-comparison.html">SQL to MongoDB Mapping Chart</a></li><li class="toctree-l2"><a class="reference internal" href="../text-search.html">Text Search</a><ul><li class="toctree-l3"><a class="reference internal" href="../core/link-text-indexes.html">Text Indexes</a></li><li class="toctree-l3"><a class="reference internal" href="../core/text-search-operators.html">Text Search Operators</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/text-search-in-aggregation.html">Text Search in the Aggregation Pipeline</a></li><li class="toctree-l3"><a class="reference internal" href="../reference/text-search-languages.html">Text Search Languages</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../geospatial-queries.html">Geospatial Queries</a><ul><li class="toctree-l3"><a class="reference internal" href="../tutorial/geospatial-tutorial.html">Find Restaurants with Geospatial Queries</a></li><li class="toctree-l3"><a class="reference internal" href="../reference/geojson.html">GeoJSON Objects</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../reference/read-concern.html">Read Isolation (Read Concern)</a><ul><li class="toctree-l3"><a class="reference internal" href="../reference/read-concern-local.html">Read Concern <code class="docutils literal"><span class="pre">&quot;local&quot;</span></code></a></li><li class="toctree-l3"><a class="reference internal" href="../reference/read-concern-available.html">Read Concern <code class="docutils literal"><span class="pre">&quot;available&quot;</span></code></a></li><li class="toctree-l3"><a class="reference internal" href="../reference/read-concern-majority.html">Read Concern <code class="docutils literal"><span class="pre">&quot;majority&quot;</span></code></a></li><li class="toctree-l3"><a class="reference internal" href="../reference/read-concern-linearizable.html">Read Concern <code class="docutils literal"><span class="pre">&quot;linearizable&quot;</span></code></a></li><li class="toctree-l3"><a class="reference internal" href="../reference/read-concern-snapshot.html">Read Concern <code class="docutils literal"><span class="pre">&quot;snapshot&quot;</span></code></a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../reference/write-concern.html">Write Acknowledgement (Write Concern)</a></li><li class="toctree-l2"><a class="reference internal" href="../core/crud.html">MongoDB CRUD Concepts</a><ul><li class="toctree-l3"><a class="reference internal" href="../core/write-operations-atomicity.html">Atomicity and Transactions</a></li><li class="toctree-l3"><a class="reference internal" href="../core/read-isolation-consistency-recency.html">Read Isolation, Consistency, and Recency</a><ul><li class="toctree-l4"><a class="reference internal" href="../core/causal-consistency-read-write-concerns.html">Causal Consistency and Read and Write Concerns</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../core/distributed-queries.html">Distributed Queries</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/perform-findAndModify-linearizable-reads.html">Linearizable Reads via <code class="docutils literal"><span class="pre">findAndModify</span></code></a></li><li class="toctree-l3"><a class="reference internal" href="../core/query-plans.html">Query Plans</a></li><li class="toctree-l3"><a class="reference internal" href="../core/query-optimization.html">Query Optimization</a><ul><li class="toctree-l4"><a class="reference internal" href="../tutorial/evaluate-operation-performance.html">Evaluate Performance of Current Operations</a></li><li class="toctree-l4"><a class="reference internal" href="../tutorial/optimize-query-performance-with-indexes-and-projections.html">Optimize Query Performance</a></li><li class="toctree-l4"><a class="reference internal" href="../core/write-performance.html">Write Operation Performance</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/explain-results.html">Explain Results</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/analyze-query-plan.html">Analyze Query Performance</a></li><li class="toctree-l3"><a class="reference internal" href="../core/tailable-cursors.html">Tailable Cursors</a></li></ul></li></ul></li><li class="toctree-l1"><a class="reference internal" href="../aggregation.html">Aggregation</a><ul><li class="toctree-l2"><a class="reference internal" href="../core/aggregation-pipeline.html">Aggregation Pipeline</a><ul><li class="toctree-l3"><a class="reference internal" href="../core/aggregation-pipeline-optimization.html">Aggregation Pipeline Optimization</a></li><li class="toctree-l3"><a class="reference internal" href="../core/aggregation-pipeline-limits.html">Aggregation Pipeline Limits</a></li><li class="toctree-l3"><a class="reference internal" href="../core/aggregation-pipeline-sharded-collections.html">Aggregation Pipeline and Sharded Collections</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/aggregation-zip-code-data-set.html">Example with ZIP Code Data</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/aggregation-with-user-preference-data.html">Example with User Preference Data</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../core/map-reduce.html">Map-Reduce</a><ul><li class="toctree-l3"><a class="reference internal" href="../core/map-reduce-sharded-collections.html">Map-Reduce and Sharded Collections</a></li><li class="toctree-l3"><a class="reference internal" href="../core/map-reduce-concurrency.html">Map-Reduce Concurrency</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/map-reduce-examples.html">Map-Reduce Examples</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/perform-incremental-map-reduce.html">Perform Incremental Map-Reduce</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/troubleshoot-map-function.html">Troubleshoot the Map Function</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/troubleshoot-reduce-function.html">Troubleshoot the Reduce Function</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../reference/aggregation.html">Aggregation Reference</a><ul><li class="toctree-l3"><a class="reference internal" href="../meta/aggregation-quick-reference.html">Aggregation Pipeline Quick Reference</a></li><li class="toctree-l3"><a class="reference internal" href="../reference/operator/aggregation/interface.html">Aggregation Commands</a></li><li class="toctree-l3"><a class="reference internal" href="../reference/aggregation-commands-comparison.html">Aggregation Commands Comparison</a></li><li class="toctree-l3"><a class="reference internal" href="../reference/aggregation-variables.html">Variables in Aggregation Expressions</a></li><li class="toctree-l3"><a class="reference internal" href="../reference/sql-aggregation-comparison.html">SQL to Aggregation Mapping Chart</a></li></ul></li></ul></li><li class="toctree-l1"><a class="reference internal" href="../data-modeling.html">Data Models</a><ul><li class="toctree-l2"><a class="reference internal" href="../core/data-modeling-introduction.html">Data Modeling Introduction</a></li><li class="toctree-l2"><a class="reference internal" href="../core/schema-validation.html">Schema Validation</a></li><li class="toctree-l2"><a class="reference internal" href="../core/data-models.html">Data Modeling Concepts</a><ul><li class="toctree-l3"><a class="reference internal" href="../core/data-model-design.html">Data Model Design</a></li><li class="toctree-l3"><a class="reference internal" href="../core/data-model-operations.html">Operational Factors and Data Models</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../applications/data-models.html">Data Model Examples and Patterns</a><ul><li class="toctree-l3"><a class="reference internal" href="../applications/data-models-relationships.html">Model Relationships Between Documents</a><ul><li class="toctree-l4"><a class="reference internal" href="../tutorial/model-embedded-one-to-one-relationships-between-documents.html">Model One-to-One Relationships with Embedded Documents</a></li><li class="toctree-l4"><a class="reference internal" href="../tutorial/model-embedded-one-to-many-relationships-between-documents.html">Model One-to-Many Relationships with Embedded Documents</a></li><li class="toctree-l4"><a class="reference internal" href="../tutorial/model-referenced-one-to-many-relationships-between-documents.html">Model One-to-Many Relationships with Document References</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../applications/data-models-tree-structures.html">Model Tree Structures</a><ul><li class="toctree-l4"><a class="reference internal" href="../tutorial/model-tree-structures-with-parent-references.html">Model Tree Structures with Parent References</a></li><li class="toctree-l4"><a class="reference internal" href="../tutorial/model-tree-structures-with-child-references.html">Model Tree Structures with Child References</a></li><li class="toctree-l4"><a class="reference internal" href="../tutorial/model-tree-structures-with-ancestors-array.html">Model Tree Structures with an Array of Ancestors</a></li><li class="toctree-l4"><a class="reference internal" href="../tutorial/model-tree-structures-with-materialized-paths.html">Model Tree Structures with Materialized Paths</a></li><li class="toctree-l4"><a class="reference internal" href="../tutorial/model-tree-structures-with-nested-sets.html">Model Tree Structures with Nested Sets</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../applications/data-models-applications.html">Model Specific Application Contexts</a><ul><li class="toctree-l4"><a class="reference internal" href="../tutorial/model-data-for-atomic-operations.html">Model Data for Atomic Operations</a></li><li class="toctree-l4"><a class="reference internal" href="../tutorial/model-data-for-keyword-search.html">Model Data to Support Keyword Search</a></li><li class="toctree-l4"><a class="reference internal" href="../tutorial/model-data-for-schema-versioning.html">Model Data for Schema Versioning</a></li><li class="toctree-l4"><a class="reference internal" href="../tutorial/model-monetary-data.html">Model Monetary Data</a></li><li class="toctree-l4"><a class="reference internal" href="../tutorial/model-time-data.html">Model Time Data</a></li><li class="toctree-l4"><a class="reference internal" href="../tutorial/model-computed-data.html">Model Computed Data</a></li></ul></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../reference/data-models.html">Data Model Reference</a><ul><li class="toctree-l3"><a class="reference internal" href="../reference/database-references.html">Database References</a></li></ul></li></ul></li><li class="toctree-l1"><a class="reference internal" href="../core/transactions.html">Transactions</a><ul><li class="toctree-l2"><a class="reference internal" href="../core/transactions-in-applications.html">Drivers API</a></li><li class="toctree-l2"><a class="reference internal" href="../core/transactions-production-consideration.html">Production Considerations</a></li><li class="toctree-l2"><a class="reference internal" href="../core/transactions-sharded-clusters.html">Production Considerations (Sharded Clusters)</a></li><li class="toctree-l2"><a class="reference internal" href="../core/transactions-operations.html">Transactions and Operations</a></li></ul></li><li class="toctree-l1"><a class="reference internal" href="../indexes.html">Indexes</a><ul><li class="toctree-l2"><a class="reference internal" href="../core/index-single.html">Single Field Indexes</a></li><li class="toctree-l2"><a class="reference internal" href="../core/index-compound.html">Compound Indexes</a></li><li class="toctree-l2"><a class="reference internal" href="../core/index-multikey.html">Multikey Indexes</a><ul><li class="toctree-l3"><a class="reference internal" href="../core/multikey-index-bounds.html">Multikey Index Bounds</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../core/index-text.html">Text Indexes</a><ul><li class="toctree-l3"><a class="reference internal" href="../tutorial/specify-language-for-text-index.html">Specify a Language for Text Index</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/avoid-text-index-name-limit.html">Specify Name for <code class="docutils literal"><span class="pre">text</span></code> Index</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/control-results-of-text-search.html">Control Search Results with Weights</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/limit-number-of-items-scanned-for-text-search.html">Limit the Number of Entries Scanned</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../core/index-wildcard.html">Wildcard Indexes</a><ul><li class="toctree-l3"><a class="reference internal" href="../reference/index-wildcard-restrictions.html">Wildcard Index Restrictions</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../core/2dsphere.html"><code class="docutils literal"><span class="pre">2dsphere</span></code> Indexes</a><ul><li class="toctree-l3"><a class="reference internal" href="../tutorial/query-a-2dsphere-index.html">Query a <code class="docutils literal"><span class="pre">2dsphere</span></code> Index</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../core/2d.html"><code class="docutils literal"><span class="pre">2d</span></code> Indexes</a><ul><li class="toctree-l3"><a class="reference internal" href="../tutorial/build-a-2d-index.html">Create a <code class="docutils literal"><span class="pre">2d</span></code> Index</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/query-a-2d-index.html">Query a <code class="docutils literal"><span class="pre">2d</span></code> Index</a></li><li class="toctree-l3"><a class="reference internal" href="../core/geospatial-indexes.html"><code class="docutils literal"><span class="pre">2d</span></code> Index Internals</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/calculate-distances-using-spherical-geometry-with-2d-geospatial-indexes.html">Calculate Distance Using Spherical Geometry</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../core/geohaystack.html"><code class="docutils literal"><span class="pre">geoHaystack</span></code> Indexes</a><ul><li class="toctree-l3"><a class="reference internal" href="../tutorial/build-a-geohaystack-index.html">Create a Haystack Index</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/query-a-geohaystack-index.html">Query a Haystack Index</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../core/index-hashed.html">Hashed Indexes</a></li><li class="toctree-l2"><a class="reference internal" href="../core/index-properties.html">Index Properties</a><ul><li class="toctree-l3"><a class="reference internal" href="../core/index-ttl.html">TTL Indexes</a><ul><li class="toctree-l4"><a class="reference internal" href="../tutorial/expire-data.html">Expire Data from Collections by Setting TTL</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../core/index-unique.html">Unique Indexes</a></li><li class="toctree-l3"><a class="reference internal" href="../core/index-partial.html">Partial Indexes</a></li><li class="toctree-l3"><a class="reference internal" href="../core/index-case-insensitive.html">Case Insensitive Indexes</a></li><li class="toctree-l3"><a class="reference internal" href="../core/index-sparse.html">Sparse Indexes</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../core/index-creation.html">Index Builds on Populated Collections</a><ul><li class="toctree-l3"><a class="reference internal" href="../tutorial/build-indexes-on-replica-sets.html">Build Indexes on Replica Sets</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/build-indexes-on-sharded-clusters.html">Build Indexes on Sharded Clusters</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../core/index-intersection.html">Index Intersection</a></li><li class="toctree-l2"><a class="reference internal" href="../tutorial/manage-indexes.html">Manage Indexes</a></li><li class="toctree-l2"><a class="reference internal" href="../tutorial/measure-index-use.html">Measure Index Use</a></li><li class="toctree-l2"><a class="reference internal" href="../applications/indexes.html">Indexing Strategies</a><ul><li class="toctree-l3"><a class="reference internal" href="../tutorial/create-indexes-to-support-queries.html">Create Indexes to Support Your Queries</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/sort-results-with-indexes.html">Use Indexes to Sort Query Results</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/ensure-indexes-fit-ram.html">Ensure Indexes Fit in RAM</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/create-queries-that-ensure-selectivity.html">Create Queries that Ensure Selectivity</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../reference/indexes.html">Indexing Reference</a></li></ul></li><li class="toctree-l1"><a class="reference internal" href="../security.html">Security</a><ul><li class="toctree-l2"><a class="reference internal" href="../administration/security-checklist.html">Security Checklist</a></li><li class="toctree-l2"><a class="reference internal" href="../tutorial/enable-authentication.html">Enable Access Control</a></li><li class="toctree-l2"><a class="reference internal" href="../core/authentication.html">Authentication</a><ul><li class="toctree-l3"><a class="reference internal" href="../core/security-users.html">Users</a><ul><li class="toctree-l4"><a class="reference internal" href="../tutorial/create-users.html">Add Users</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../core/authentication-mechanisms.html">Authentication Mechanisms</a><ul><li class="toctree-l4"><a class="reference internal" href="../core/security-scram.html">SCRAM</a></li><li class="toctree-l4"><a class="reference internal" href="../core/security-x.509.html">x.509</a><ul><li class="toctree-l5"><a class="reference internal" href="../tutorial/configure-x509-client-authentication.html">Use x.509 Certificates to Authenticate Clients</a></li></ul></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../core/authentication-mechanisms-enterprise.html">Enterprise Authentication Mechanisms</a><ul><li class="toctree-l4"><a class="reference internal" href="../core/kerberos.html">Kerberos Authentication</a><ul><li class="toctree-l5"><a class="reference internal" href="../tutorial/control-access-to-mongodb-with-kerberos-authentication.html">Configure MongoDB with Kerberos Authentication on Linux</a></li><li class="toctree-l5"><a class="reference internal" href="../tutorial/control-access-to-mongodb-windows-with-kerberos-authentication.html">Configure MongoDB with Kerberos Authentication on Windows</a></li><li class="toctree-l5"><a class="reference internal" href="../tutorial/troubleshoot-kerberos.html">Troubleshoot Kerberos Authentication</a></li><li class="toctree-l5"><a class="reference internal" href="../tutorial/kerberos-auth-activedirectory-authz.html">Configure MongoDB with Kerberos Authentication and Active Directory Authorization</a></li></ul></li><li class="toctree-l4"><a class="reference internal" href="../core/security-ldap.html">LDAP Proxy Authentication</a><ul><li class="toctree-l5"><a class="reference internal" href="../tutorial/configure-ldap-sasl-activedirectory.html">Authenticate Using SASL and LDAP with ActiveDirectory</a></li><li class="toctree-l5"><a class="reference internal" href="../tutorial/configure-ldap-sasl-openldap.html">Authenticate Using SASL and LDAP with OpenLDAP</a></li><li class="toctree-l5"><a class="reference internal" href="../tutorial/authenticate-nativeldap-activedirectory.html">Authenticate and Authorize Users Using Active Directory via Native LDAP</a></li></ul></li><li class="toctree-l4"><a class="reference internal" href="../core/security-ldap-external.html">LDAP Authorization</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../core/security-internal-authentication.html">Internal/Membership Authentication</a><ul><li class="toctree-l4"><a class="reference internal" href="../tutorial/deploy-replica-set-with-keyfile-access-control.html">Deploy Replica Set With Keyfile Authentication</a></li><li class="toctree-l4"><a class="reference internal" href="../tutorial/enforce-keyfile-access-control-in-existing-replica-set.html">Update Replica Set to Keyfile Authentication</a></li><li class="toctree-l4"><a class="reference internal" href="../tutorial/enforce-keyfile-access-control-in-existing-replica-set-without-downtime.html">Update Replica Set to Keyfile Authentication (No Downtime)</a></li><li class="toctree-l4"><a class="reference internal" href="../tutorial/rotate-key-replica-set.html">Rotate Keys for Replica Sets</a></li><li class="toctree-l4"><a class="reference internal" href="../tutorial/deploy-sharded-cluster-with-keyfile-access-control.html">Deploy Sharded Cluster with Keyfile Authentication</a></li><li class="toctree-l4"><a class="reference internal" href="../tutorial/enforce-keyfile-access-control-in-existing-sharded-cluster.html">Update Sharded Cluster to Keyfile Authentication</a></li><li class="toctree-l4"><a class="reference internal" href="../tutorial/enforce-keyfile-access-control-in-existing-sharded-cluster-no-downtime.html">Update Sharded Cluster to Keyfile Authentication (No Downtime)</a></li><li class="toctree-l4"><a class="reference internal" href="../tutorial/rotate-key-sharded-cluster.html">Rotate Keys for Sharded Clusters</a></li><li class="toctree-l4"><a class="reference internal" href="../tutorial/configure-x509-member-authentication.html">Use x.509 Certificate for Membership Authentication</a></li><li class="toctree-l4"><a class="reference internal" href="../tutorial/upgrade-keyfile-to-x509.html">Upgrade from Keyfile Authentication to x.509 Authentication</a></li><li class="toctree-l4"><a class="reference internal" href="../tutorial/rotate-x509-membership-certificates.html">Rolling Update of x.509 Cluster Certificates that Contain New DN</a></li></ul></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../core/authorization.html">Role-Based Access Control</a><ul><li class="toctree-l3"><a class="reference internal" href="../reference/built-in-roles.html">Built-In Roles</a></li><li class="toctree-l3"><a class="reference internal" href="../core/security-user-defined-roles.html">User-Defined Roles</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/manage-users-and-roles.html">Manage Users and Roles</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/change-own-password-and-custom-data.html">Change Your Password and Custom Data</a></li><li class="toctree-l3"><a class="reference internal" href="../core/collection-level-access-control.html">Collection-Level Access Control</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../core/security-transport-encryption.html">TLS/SSL (Transport Encryption)</a><ul><li class="toctree-l3"><a class="reference internal" href="../tutorial/configure-ssl.html">Configure <code class="docutils literal"><span class="pre">mongod</span></code> and <code class="docutils literal"><span class="pre">mongos</span></code> for TLS/SSL</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/configure-ssl-clients.html">TLS/SSL Configuration for Clients</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/upgrade-cluster-to-ssl.html">Upgrade a Cluster to Use TLS/SSL</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/configure-fips.html">Configure MongoDB for FIPS</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../core/security-encryption-at-rest.html">Encryption at Rest</a><ul><li class="toctree-l3"><a class="reference internal" href="../tutorial/configure-encryption.html">Configure Encryption</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/rotate-encryption-key.html">Rotate Encryption Keys</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../core/security-client-side-encryption.html">Client-Side Field Level Encryption</a><ul><li class="toctree-l3"><a class="reference internal" href="../core/security-automatic-client-side-encryption.html">Automatic Client-Side Field Level Encryption</a><ul><li class="toctree-l4"><a class="reference internal" href="../reference/security-client-side-automatic-json-schema.html">Automatic Encryption Rules</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/security-client-side-query-aggregation-support.html">Read/Write Support with Automatic Field Level Encryption</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/security-client-side-encryption-appendix.html">Appendix</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../core/security-explicit-client-side-encryption.html">Explicit (Manual) Client-Side Field Level Encryption</a></li><li class="toctree-l3"><a class="reference internal" href="../core/security-client-side-encryption-key-management.html">Master Key and Data Encryption Key Management</a><ul><li class="toctree-l4"><a class="reference internal" href="../tutorial/manage-client-side-encryption-data-keys.html">Manage Data Encryption Keys</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../reference/security-client-side-encryption-limitations.html">Limitations</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../core/auditing.html">Auditing</a><ul><li class="toctree-l3"><a class="reference internal" href="../tutorial/configure-auditing.html">Configure Auditing</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/configure-audit-filters.html">Configure Audit Filters</a></li><li class="toctree-l3"><a class="reference internal" href="../reference/audit-message.html">System Event Audit Messages</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../core/security-hardening.html">Network and Configuration Hardening</a><ul><li class="toctree-l3"><a class="reference internal" href="../core/security-mongodb-configuration.html">IP Binding</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/configure-linux-iptables-firewall.html">Configure Linux <code class="docutils literal"><span class="pre">iptables</span></code> Firewall for MongoDB</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/configure-windows-netsh-firewall.html">Configure Windows <code class="docutils literal"><span class="pre">netsh</span></code> Firewall for MongoDB</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../tutorial/implement-field-level-redaction.html">Implement Field Level Redaction</a></li><li class="toctree-l2"><a class="reference internal" href="../reference/security.html">Security Reference</a><ul><li class="toctree-l3"><a class="reference internal" href="../reference/system-roles-collection.html"><code class="docutils literal"><span class="pre">system.roles</span></code> Collection</a></li><li class="toctree-l3"><a class="reference internal" href="../reference/system-users-collection.html"><code class="docutils literal"><span class="pre">system.users</span></code> Collection</a></li><li class="toctree-l3"><a class="reference internal" href="../reference/resource-document.html">Resource Document</a></li><li class="toctree-l3"><a class="reference internal" href="../reference/privilege-actions.html">Privilege Actions</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../tutorial/create-a-vulnerability-report.html">Create a Vulnerability Report</a></li><li class="toctree-l2"><a class="reference internal" href="../appendix/security.html">Appendix</a><ul><li class="toctree-l3"><a class="reference internal" href="../appendix/security/appendixA-openssl-ca.html">Appendix A - OpenSSL CA Certificate for Testing</a></li><li class="toctree-l3"><a class="reference internal" href="../appendix/security/appendixB-openssl-server.html">Appendix B - OpenSSL Server Certificates for Testing</a></li><li class="toctree-l3"><a class="reference internal" href="../appendix/security/appendixC-openssl-client.html">Appendix C - OpenSSL Client Certificates for Testing</a></li></ul></li></ul></li><li class="toctree-l1"><a class="reference internal" href="../changeStreams.html">Change Streams</a><ul><li class="toctree-l2"><a class="reference internal" href="../administration/change-streams-production-recommendations.html">Change Streams Production Recommendations</a></li><li class="toctree-l2"><a class="reference internal" href="../reference/change-events.html">Change Events</a></li></ul></li><li class="toctree-l1"><a class="reference internal" href="../replication.html">Replication</a><ul><li class="toctree-l2"><a class="reference internal" href="../core/replica-set-members.html">Replica Set Members</a><ul><li class="toctree-l3"><a class="reference internal" href="../core/replica-set-primary.html">Replica Set Primary</a></li><li class="toctree-l3"><a class="reference internal" href="../core/replica-set-secondary.html">Replica Set Secondary Members</a><ul><li class="toctree-l4"><a class="reference internal" href="../core/replica-set-priority-0-member.html">Priority 0 Replica Set Members</a></li><li class="toctree-l4"><a class="reference internal" href="../core/replica-set-hidden-member.html">Hidden Replica Set Members</a></li><li class="toctree-l4"><a class="reference internal" href="../core/replica-set-delayed-member.html">Delayed Replica Set Members</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../core/replica-set-arbiter.html">Replica Set Arbiter</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../core/replica-set-oplog.html">Replica Set Oplog</a></li><li class="toctree-l2"><a class="reference internal" href="../core/replica-set-sync.html">Replica Set Data Synchronization</a></li><li class="toctree-l2"><a class="reference internal" href="../core/replica-set-architectures.html">Replica Set Deployment Architectures</a><ul><li class="toctree-l3"><a class="reference internal" href="../core/replica-set-architecture-three-members.html">Three Member Replica Sets</a></li><li class="toctree-l3"><a class="reference internal" href="../core/replica-set-architecture-geographically-distributed.html">Replica Sets Distributed Across Two or More Data Centers</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../core/replica-set-high-availability.html">Replica Set High Availability</a><ul><li class="toctree-l3"><a class="reference internal" href="../core/replica-set-elections.html">Replica Set Elections</a></li><li class="toctree-l3"><a class="reference internal" href="../core/replica-set-rollbacks.html">Rollbacks During Replica Set Failover</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../applications/replication.html">Replica Set Read and Write Semantics</a><ul><li class="toctree-l3"><a class="reference internal" href="../core/replica-set-write-concern.html">Write Concern for Replica Sets</a></li><li class="toctree-l3"><a class="reference internal" href="../core/read-preference.html">Read Preference</a><ul><li class="toctree-l4"><a class="reference internal" href="../core/read-preference-tags.html">Tag Sets</a></li><li class="toctree-l4"><a class="reference internal" href="../core/read-preference-staleness.html">maxStalenessSeconds</a></li><li class="toctree-l4"><a class="reference internal" href="../core/read-preference-use-cases.html">Read Preference Use Cases</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../core/read-preference-mechanics.html">Server Selection Algorithm</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../administration/replica-set-deployment.html">Replica Set Deployment Tutorials</a><ul><li class="toctree-l3"><a class="reference internal" href="../tutorial/deploy-replica-set.html">Deploy a Replica Set</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/deploy-replica-set-for-testing.html">Deploy a Replica Set for Testing and Development</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/deploy-geographically-distributed-replica-set.html">Deploy a Geographically Redundant Replica Set</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/add-replica-set-arbiter.html">Add an Arbiter to Replica Set</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/convert-standalone-to-replica-set.html">Convert a Standalone to a Replica Set</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/expand-replica-set.html">Add Members to a Replica Set</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/remove-replica-set-member.html">Remove Members from Replica Set</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/replace-replica-set-member.html">Replace a Replica Set Member</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../administration/replica-set-member-configuration.html">Member Configuration Tutorials</a><ul><li class="toctree-l3"><a class="reference internal" href="../tutorial/adjust-replica-set-member-priority.html">Adjust Priority for Replica Set Member</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/configure-secondary-only-replica-set-member.html">Prevent Secondary from Becoming Primary</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/configure-a-hidden-replica-set-member.html">Configure a Hidden Replica Set Member</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/configure-a-delayed-replica-set-member.html">Configure a Delayed Replica Set Member</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/configure-a-non-voting-replica-set-member.html">Configure Non-Voting Replica Set Member</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/convert-secondary-into-arbiter.html">Convert a Secondary to an Arbiter</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../administration/replica-set-maintenance.html">Replica Set Maintenance Tutorials</a><ul><li class="toctree-l3"><a class="reference internal" href="../tutorial/change-oplog-size.html">Change the Size of the Oplog</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/perform-maintence-on-replica-set-members.html">Perform Maintenance on Replica Set Members</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/force-member-to-be-primary.html">Force a Member to Become Primary</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/resync-replica-set-member.html">Resync a Member of a Replica Set</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/configure-replica-set-tag-sets.html">Configure Replica Set Tag Sets</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/reconfigure-replica-set-with-unavailable-members.html">Reconfigure a Replica Set with Unavailable Members</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/manage-chained-replication.html">Manage Chained Replication</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/change-hostnames-in-a-replica-set.html">Change Hostnames in a Replica Set</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/configure-replica-set-secondary-sync-target.html">Configure a Secondary’s Sync Target</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../reference/replication.html">Replication Reference</a><ul><li class="toctree-l3"><a class="reference internal" href="../reference/replica-configuration.html">Replica Set Configuration</a></li><li class="toctree-l3"><a class="reference internal" href="../reference/replica-set-protocol-versions.html">Replica Set Protocol Version</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/troubleshoot-replica-sets.html">Troubleshoot Replica Sets</a></li><li class="toctree-l3"><a class="reference internal" href="../reference/local-database.html">The <code class="docutils literal"><span class="pre">local</span></code> Database</a></li><li class="toctree-l3"><a class="reference internal" href="../reference/replica-states.html">Replica Set Member States</a></li></ul></li></ul></li><li class="toctree-l1"><a class="reference internal" href="../sharding.html">Sharding</a><ul><li class="toctree-l2"><a class="reference internal" href="../core/sharded-cluster-components.html">Sharded Cluster Components</a><ul><li class="toctree-l3"><a class="reference internal" href="../core/sharded-cluster-shards.html">Shards</a></li><li class="toctree-l3"><a class="reference internal" href="../core/sharded-cluster-config-servers.html">Config Servers (metadata)</a></li><li class="toctree-l3"><a class="reference internal" href="../core/sharded-cluster-query-router.html">Router (mongos)</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../core/sharding-shard-key.html">Shard Keys</a></li><li class="toctree-l2"><a class="reference internal" href="../core/hashed-sharding.html">Hashed Sharding</a></li><li class="toctree-l2"><a class="reference internal" href="../core/ranged-sharding.html">Ranged Sharding</a></li><li class="toctree-l2"><a class="reference internal" href="../tutorial/deploy-shard-cluster.html">Deploy a Sharded Cluster</a></li><li class="toctree-l2"><a class="reference internal" href="../core/zone-sharding.html">Zones</a><ul><li class="toctree-l3"><a class="reference internal" href="../tutorial/manage-shard-zone.html">Manage Shard Zones</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/sharding-segmenting-data-by-location.html">Segmenting Data by Location</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/sharding-tiered-hardware-for-varying-slas.html">Tiered Hardware for Varying SLA or SLO</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/sharding-segmenting-shards.html">Segmenting Data by Application or Customer</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/sharding-high-availability-writes.html">Distributed Local Writes for Insert Only Workloads</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../core/sharding-data-partitioning.html">Data Partitioning with Chunks</a><ul><li class="toctree-l3"><a class="reference internal" href="../tutorial/create-chunks-in-sharded-cluster.html">Create Chunks in a Sharded Cluster</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/split-chunks-in-sharded-cluster.html">Split Chunks in a Sharded Cluster</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/merge-chunks-in-sharded-cluster.html">Merge Chunks in a Sharded Cluster</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/modify-chunk-size-in-sharded-cluster.html">Modify Chunk Size in a Sharded Cluster</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../core/sharding-balancer-administration.html">Balancer</a><ul><li class="toctree-l3"><a class="reference internal" href="../tutorial/manage-sharded-cluster-balancer.html">Manage Sharded Cluster Balancer</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/migrate-chunks-in-sharded-cluster.html">Migrate Chunks in a Sharded Cluster</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../administration/sharded-cluster-administration.html">Administration</a><ul><li class="toctree-l3"><a class="reference internal" href="../administration/sharded-cluster-config-servers.html">Config Server Administration</a><ul><li class="toctree-l4"><a class="reference internal" href="../tutorial/replace-config-server.html">Replace a Config Server</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/view-sharded-cluster-configuration.html">View Cluster Configuration</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/restart-sharded-cluster.html">Restart a Sharded Cluster</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/migrate-sharded-cluster-to-new-hardware.html">Migrate a Sharded Cluster to Different Hardware</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/add-shards-to-shard-cluster.html">Add Shards to a Cluster</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/remove-shards-from-cluster.html">Remove Shards from an Existing Sharded Cluster</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/clear-jumbo-flag.html">Clear <code class="docutils literal"><span class="pre">jumbo</span></code> Flag</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/backup-sharded-cluster-metadata.html">Back Up Cluster Metadata</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/convert-sharded-cluster-to-replica-set.html">Convert Sharded Cluster to Replica Set</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/convert-replica-set-to-replicated-shard-cluster.html">Convert a Replica Set to a Sharded Cluster</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/convert-shard-standalone-to-shard-replica-set.html">Convert a Shard Standalone to a Shard Replica Set</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../reference/sharding.html">Sharding Reference</a><ul><li class="toctree-l3"><a class="reference internal" href="../core/sharded-cluster-requirements.html">Operational Restrictions</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/troubleshoot-sharded-clusters.html">Troubleshoot Sharded Clusters</a></li><li class="toctree-l3"><a class="reference internal" href="../reference/config-database.html">Config Database</a></li></ul></li></ul></li><li class="toctree-l1"><a class="reference internal" href="../administration.html">Administration</a><ul><li class="toctree-l2"><a class="reference internal" href="../administration/production-notes.html">Production Notes</a></li><li class="toctree-l2"><a class="reference internal" href="../administration/production-checklist-operations.html">Operations Checklist</a></li><li class="toctree-l2"><a class="reference internal" href="../administration/production-checklist-development.html">Development Checklist</a></li><li class="toctree-l2"><a class="reference internal" href="../administration/analyzing-mongodb-performance.html">Performance</a><ul><li class="toctree-l3"><a class="reference internal" href="../tutorial/manage-the-database-profiler.html">Database Profiler</a><ul><li class="toctree-l4"><a class="reference internal" href="../reference/database-profiler.html">Database Profiler Output</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/transparent-huge-pages.html">Disable Transparent Huge Pages (THP)</a></li><li class="toctree-l3"><a class="reference internal" href="../reference/ulimit.html">UNIX <code class="docutils literal"><span class="pre">ulimit</span></code> Settings</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../administration/configuration-and-maintenance.html">Configuration and Maintenance</a><ul><li class="toctree-l3"><a class="reference internal" href="../administration/configuration.html">Run-time Database Configuration</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/upgrade-revision.html">Upgrade to the Latest Revision of MongoDB</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/manage-mongodb-processes.html">Manage <code class="docutils literal"><span class="pre">mongod</span></code> Processes</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/terminate-running-operations.html">Terminate Running Operations</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/rotate-log-files.html">Rotate Log Files</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../data-center-awareness.html">Data Center Awareness</a><ul><li class="toctree-l3"><a class="reference internal" href="../core/workload-isolation.html">Workload Isolation in MongoDB Deployments</a></li><li class="toctree-l3"><a class="reference internal" href="../core/zone-sharding.html">Zones</a><ul><li class="toctree-l4"><a class="reference internal" href="../tutorial/manage-shard-zone.html">Manage Shard Zones</a></li><li class="toctree-l4"><a class="reference internal" href="../tutorial/sharding-segmenting-data-by-location.html">Segmenting Data by Location</a></li><li class="toctree-l4"><a class="reference internal" href="../tutorial/sharding-tiered-hardware-for-varying-slas.html">Tiered Hardware for Varying SLA or SLO</a></li><li class="toctree-l4"><a class="reference internal" href="../tutorial/sharding-segmenting-shards.html">Segmenting Data by Application or Customer</a></li><li class="toctree-l4"><a class="reference internal" href="../tutorial/sharding-high-availability-writes.html">Distributed Local Writes for Insert Only Workloads</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/manage-shard-zone.html">Manage Shard Zones</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../core/backups.html">MongoDB Backup Methods</a><ul><li class="toctree-l3"><a class="reference internal" href="../tutorial/backup-with-filesystem-snapshots.html">Back Up and Restore with Filesystem Snapshots</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/backup-and-restore-tools.html">Back Up and Restore with MongoDB Tools</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/restore-replica-set-from-backup.html">Restore a Replica Set from MongoDB Backups</a></li><li class="toctree-l3"><a class="reference internal" href="../administration/backup-sharded-clusters.html">Backup and Restore Sharded Clusters</a><ul><li class="toctree-l4"><a class="reference internal" href="../tutorial/backup-sharded-cluster-with-filesystem-snapshots.html">Back Up a Sharded Cluster with File System Snapshots</a></li><li class="toctree-l4"><a class="reference internal" href="../tutorial/backup-sharded-cluster-with-database-dumps.html">Back Up a Sharded Cluster with Database Dumps</a></li><li class="toctree-l4"><a class="reference internal" href="../tutorial/schedule-backup-window-for-sharded-clusters.html">Schedule Backup Window for Sharded Clusters</a></li><li class="toctree-l4"><a class="reference internal" href="../tutorial/restore-sharded-cluster.html">Restore a Sharded Cluster</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/recover-data-following-unexpected-shutdown.html">Recover a Standalone after an Unexpected Shutdown</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../administration/monitoring.html">Monitoring for MongoDB</a><ul><li class="toctree-l3"><a class="reference internal" href="../administration/free-monitoring.html">Free Monitoring</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/monitor-with-snmp.html">Monitor MongoDB With SNMP on Linux</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/monitor-with-snmp-on-windows.html">Monitor MongoDB Windows with SNMP</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/troubleshoot-snmp.html">Troubleshoot SNMP</a></li></ul></li></ul></li><li class="toctree-l1"><a class="reference internal" href="../storage.html">Storage</a><ul><li class="toctree-l2"><a class="reference internal" href="../core/storage-engines.html">Storage Engines</a><ul><li class="toctree-l3"><a class="reference internal" href="../core/wiredtiger.html">WiredTiger Storage Engine</a><ul><li class="toctree-l4"><a class="reference internal" href="../tutorial/change-standalone-wiredtiger.html">Change Standalone to WiredTiger</a></li><li class="toctree-l4"><a class="reference internal" href="../tutorial/change-replica-set-wiredtiger.html">Change Replica Set to WiredTiger</a></li><li class="toctree-l4"><a class="reference internal" href="../tutorial/change-sharded-cluster-wiredtiger.html">Change Sharded Cluster to WiredTiger</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../core/inmemory.html">In-Memory Storage Engine</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../core/journaling.html">Journaling</a><ul><li class="toctree-l3"><a class="reference internal" href="../tutorial/manage-journaling.html">Manage Journaling</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../core/gridfs.html">GridFS</a></li><li class="toctree-l2"><a class="reference internal" href="../faq/storage.html">FAQ: MongoDB Storage</a></li></ul></li><li class="toctree-l1"><a class="reference internal" href="../faq.html">Frequently Asked Questions</a><ul><li class="toctree-l2"><a class="reference internal" href="../faq/fundamentals.html">FAQ: MongoDB Fundamentals</a></li><li class="toctree-l2"><a class="reference internal" href="../faq/indexes.html">FAQ: Indexes</a></li><li class="toctree-l2"><a class="reference internal" href="../faq/concurrency.html">FAQ: Concurrency</a></li><li class="toctree-l2"><a class="reference internal" href="../faq/sharding.html">FAQ: Sharding with MongoDB</a></li><li class="toctree-l2"><a class="reference internal" href="../faq/replica-sets.html">FAQ: Replication and Replica Sets</a></li><li class="toctree-l2"><a class="reference internal" href="../faq/storage.html">FAQ: MongoDB Storage</a></li><li class="toctree-l2"><a class="reference internal" href="../faq/diagnostics.html">FAQ: MongoDB Diagnostics</a></li></ul></li><li class="toctree-l1"><a class="reference internal" href="../reference.html">Reference</a><ul><li class="toctree-l2"><a class="reference internal" href="../reference/operator.html">Operators</a><ul><li class="toctree-l3"><a class="reference internal" href="../reference/operator/query.html">Query and Projection Operators</a><ul><li class="toctree-l4"><a class="reference internal" href="../reference/operator/query-comparison.html">Comparison Query Operators</a><ul><li class="toctree-l5"><a class="reference internal" href="../reference/operator/query/eq.html">$eq</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/operator/query/gt.html">$gt</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/operator/query/gte.html">$gte</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/operator/query/in.html">$in</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/operator/query/lt.html">$lt</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/operator/query/lte.html">$lte</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/operator/query/ne.html">$ne</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/operator/query/nin.html">$nin</a></li></ul></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/query-logical.html">Logical Query Operators</a><ul><li class="toctree-l5"><a class="reference internal" href="../reference/operator/query/and.html">$and</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/operator/query/not.html">$not</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/operator/query/nor.html">$nor</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/operator/query/or.html">$or</a></li></ul></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/query-element.html">Element Query Operators</a><ul><li class="toctree-l5"><a class="reference internal" href="../reference/operator/query/exists.html">$exists</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/operator/query/type.html">$type</a></li></ul></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/query-evaluation.html">Evaluation Query Operators</a><ul><li class="toctree-l5"><a class="reference internal" href="../reference/operator/query/expr.html">$expr</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/operator/query/jsonSchema.html">$jsonSchema</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/operator/query/mod.html">$mod</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/operator/query/regex.html">$regex</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/operator/query/text.html">$text</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/operator/query/where.html">$where</a></li></ul></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/query-geospatial.html">Geospatial Query Operators</a><ul><li class="toctree-l5"><a class="reference internal" href="../reference/operator/query/geoIntersects.html">$geoIntersects</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/operator/query/geoWithin.html">$geoWithin</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/operator/query/near.html">$near</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/operator/query/nearSphere.html">$nearSphere</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/operator/query/box.html">$box</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/operator/query/center.html">$center</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/operator/query/centerSphere.html">$centerSphere</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/operator/query/geometry.html">$geometry</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/operator/query/maxDistance.html">$maxDistance</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/operator/query/minDistance.html">$minDistance</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/operator/query/polygon.html">$polygon</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/operator/query/uniqueDocs.html">$uniqueDocs</a></li></ul></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/query-array.html">Array Query Operators</a><ul><li class="toctree-l5"><a class="reference internal" href="../reference/operator/query/all.html">$all</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/operator/query/elemMatch.html">$elemMatch (query)</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/operator/query/size.html">$size</a></li></ul></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/query-bitwise.html">Bitwise Query Operators</a><ul><li class="toctree-l5"><a class="reference internal" href="../reference/operator/query/bitsAllClear.html">$bitsAllClear</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/operator/query/bitsAllSet.html">$bitsAllSet</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/operator/query/bitsAnyClear.html">$bitsAnyClear</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/operator/query/bitsAnySet.html">$bitsAnySet</a></li></ul></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/query/comment.html">$comment</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/projection.html">Projection Operators</a><ul><li class="toctree-l5"><a class="reference internal" href="../reference/operator/projection/positional.html">$ (projection)</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/operator/projection/elemMatch.html">$elemMatch (projection)</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/operator/projection/meta.html">$meta</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/operator/projection/slice.html">$slice (projection)</a></li></ul></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../reference/operator/update.html">Update Operators</a><ul><li class="toctree-l4"><a class="reference internal" href="../reference/operator/update-field.html">Field Update Operators</a><ul><li class="toctree-l5"><a class="reference internal" href="../reference/operator/update/currentDate.html">$currentDate</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/operator/update/inc.html">$inc</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/operator/update/min.html">$min</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/operator/update/max.html">$max</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/operator/update/mul.html">$mul</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/operator/update/rename.html">$rename</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/operator/update/set.html">$set</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/operator/update/setOnInsert.html">$setOnInsert</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/operator/update/unset.html">$unset</a></li></ul></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/update-array.html">Array Update Operators</a><ul><li class="toctree-l5"><a class="reference internal" href="../reference/operator/update/positional.html">$ (update)</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/operator/update/positional-all.html">$[]</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/operator/update/positional-filtered.html">$[&lt;identifier&gt;]</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/operator/update/addToSet.html">$addToSet</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/operator/update/pop.html">$pop</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/operator/update/pull.html">$pull</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/operator/update/push.html">$push</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/operator/update/pullAll.html">$pullAll</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/operator/update/each.html">$each</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/operator/update/position.html">$position</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/operator/update/slice.html">$slice</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/operator/update/sort.html">$sort</a></li></ul></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/update-bitwise.html">Bitwise Update Operator</a><ul><li class="toctree-l5"><a class="reference internal" href="../reference/operator/update/bit.html">$bit</a></li></ul></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../reference/operator/aggregation-pipeline.html">Aggregation Pipeline Stages</a><ul><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/addFields.html">$addFields (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/bucket.html">$bucket (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/bucketAuto.html">$bucketAuto (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/collStats.html">$collStats (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/count.html">$count (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/currentOp.html">$currentOp (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/facet.html">$facet (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/geoNear.html">$geoNear (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/graphLookup.html">$graphLookup (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/group.html">$group (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/indexStats.html">$indexStats (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/limit.html">$limit (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/listLocalSessions.html">$listLocalSessions</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/listSessions.html">$listSessions</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/lookup.html">$lookup (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/match.html">$match (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/merge.html">$merge (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/out.html">$out (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/planCacheStats.html">$planCacheStats</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/project.html">$project (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/redact.html">$redact (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/replaceRoot.html">$replaceRoot (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/replaceWith.html">$replaceWith (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/sample.html">$sample (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/set.html">$set (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/skip.html">$skip (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/sort.html">$sort (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/sortByCount.html">$sortByCount (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/unset.html">$unset (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/unwind.html">$unwind (aggregation)</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../reference/operator/aggregation.html">Aggregation Pipeline Operators</a><ul><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/abs.html">$abs (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/acos.html">$acos (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/acosh.html">$acosh (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/add.html">$add (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/addToSet.html">$addToSet (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/allElementsTrue.html">$allElementsTrue (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/and.html">$and (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/anyElementTrue.html">$anyElementTrue (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/arrayElemAt.html">$arrayElemAt (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/arrayToObject.html">$arrayToObject (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/asin.html">$asin (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/asinh.html">$asinh (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/atan.html">$atan (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/atan2.html">$atan2 (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/atanh.html">$atanh (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/avg.html">$avg (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/ceil.html">$ceil (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/cmp.html">$cmp (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/concat.html">$concat (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/concatArrays.html">$concatArrays (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/cond.html">$cond (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/convert.html">$convert (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/cos.html">$cos (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/dateFromParts.html">$dateFromParts (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/dateToParts.html">$dateToParts (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/dateFromString.html">$dateFromString (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/dateToString.html">$dateToString (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/dayOfMonth.html">$dayOfMonth (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/dayOfWeek.html">$dayOfWeek (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/dayOfYear.html">$dayOfYear (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/degreesToRadians.html">$degreesToRadians (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/divide.html">$divide (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/eq.html">$eq (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/exp.html">$exp (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/filter.html">$filter (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/first.html">$first (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/floor.html">$floor (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/gt.html">$gt (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/gte.html">$gte (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/hour.html">$hour (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/ifNull.html">$ifNull (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/in.html">$in (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/indexOfArray.html">$indexOfArray (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/indexOfBytes.html">$indexOfBytes (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/indexOfCP.html">$indexOfCP (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/isArray.html">$isArray (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/isoDayOfWeek.html">$isoDayOfWeek (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/isoWeek.html">$isoWeek (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/isoWeekYear.html">$isoWeekYear (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/last.html">$last (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/let.html">$let (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/literal.html">$literal (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/ln.html">$ln (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/log.html">$log (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/log10.html">$log10 (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/lt.html">$lt (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/lte.html">$lte (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/ltrim.html">$ltrim (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/map.html">$map (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/max.html">$max (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/mergeObjects.html">$mergeObjects (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/meta.html">$meta (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/min.html">$min (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/millisecond.html">$millisecond (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/minute.html">$minute (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/mod.html">$mod (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/month.html">$month (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/multiply.html">$multiply (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/ne.html">$ne (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/not.html">$not (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/objectToArray.html">$objectToArray (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/or.html">$or (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/pow.html">$pow (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/push.html">$push (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/radiansToDegrees.html">$radiansToDegrees (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/range.html">$range (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/reduce.html">$reduce (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/regexFind.html">$regexFind (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/regexFindAll.html">$regexFindAll (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/regexMatch.html">$regexMatch (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/reverseArray.html">$reverseArray (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/round.html">$round (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/rtrim.html">$rtrim (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/second.html">$second (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/setDifference.html">$setDifference (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/setEquals.html">$setEquals (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/setIntersection.html">$setIntersection (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/setIsSubset.html">$setIsSubset (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/setUnion.html">$setUnion (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/size.html">$size (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/sin.html">$sin (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/slice.html">$slice (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/split.html">$split (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/sqrt.html">$sqrt (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/stdDevPop.html">$stdDevPop (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/stdDevSamp.html">$stdDevSamp (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/strcasecmp.html">$strcasecmp (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/strLenBytes.html">$strLenBytes (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/strLenCP.html">$strLenCP (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/substr.html">$substr (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/substrBytes.html">$substrBytes (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/substrCP.html">$substrCP (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/subtract.html">$subtract (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/sum.html">$sum (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/switch.html">$switch (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/tan.html">$tan (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/toBool.html">$toBool (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/toDate.html">$toDate (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/toDecimal.html">$toDecimal (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/toDouble.html">$toDouble(aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/toInt.html">$toInt (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/toLong.html">$toLong (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/toObjectId.html">$toObjectId (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/toString.html">$toString (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/toLower.html">$toLower (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/toUpper.html">$toUpper (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/trim.html">$trim (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/trunc.html">$trunc (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/type.html">$type (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/week.html">$week (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/year.html">$year (aggregation)</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/aggregation/zip.html">$zip (aggregation)</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../reference/operator/query-modifier.html">Query Modifiers</a><ul><li class="toctree-l4"><a class="reference internal" href="../reference/operator/meta/comment.html">$comment</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/meta/explain.html">$explain</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/meta/hint.html">$hint</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/meta/max.html">$max</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/meta/maxTimeMS.html">$maxTimeMS</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/meta/min.html">$min</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/meta/orderby.html">$orderby</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/meta/query.html">$query</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/meta/returnKey.html">$returnKey</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/meta/showDiskLoc.html">$showDiskLoc</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/operator/meta/natural.html">$natural</a></li></ul></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../reference/command.html">Database Commands</a><ul><li class="toctree-l3"><a class="reference internal" href="../reference/command/nav-aggregation.html">Aggregation Commands</a><ul><li class="toctree-l4"><a class="reference internal" href="../reference/command/aggregate.html">aggregate</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/count.html">count</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/distinct.html">distinct</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/mapReduce.html">mapReduce</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../reference/command/nav-geospatial.html">Geospatial Commands</a><ul><li class="toctree-l4"><a class="reference internal" href="../reference/command/geoSearch.html">geoSearch</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../reference/command/nav-crud.html">Query and Write Operation Commands</a><ul><li class="toctree-l4"><a class="reference internal" href="../reference/command/delete.html">delete</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/find.html">find</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/findAndModify.html">findAndModify</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/getLastError.html">getLastError</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/getMore.html">getMore</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/insert.html">insert</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/resetError.html">resetError</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/update.html">update</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../reference/command/nav-plan-cache.html">Query Plan Cache Commands</a><ul><li class="toctree-l4"><a class="reference internal" href="../reference/command/planCacheClear.html">planCacheClear</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/planCacheClearFilters.html">planCacheClearFilters</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/planCacheListFilters.html">planCacheListFilters</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/planCacheListPlans.html">planCacheListPlans</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/planCacheListQueryShapes.html">planCacheListQueryShapes</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/planCacheSetFilter.html">planCacheSetFilter</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../reference/command/nav-authentication.html">Authentication Commands</a><ul><li class="toctree-l4"><a class="reference internal" href="../reference/command/authenticate.html">authenticate</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/getnonce.html">getnonce</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/logout.html">logout</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../reference/command/nav-user-management.html">User Management Commands</a><ul><li class="toctree-l4"><a class="reference internal" href="../reference/command/createUser.html">createUser</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/dropAllUsersFromDatabase.html">dropAllUsersFromDatabase</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/dropUser.html">dropUser</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/grantRolesToUser.html">grantRolesToUser</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/revokeRolesFromUser.html">revokeRolesFromUser</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/updateUser.html">updateUser</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/usersInfo.html">usersInfo</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../reference/command/nav-role-management.html">Role Management Commands</a><ul><li class="toctree-l4"><a class="reference internal" href="../reference/command/createRole.html">createRole</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/dropRole.html">dropRole</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/dropAllRolesFromDatabase.html">dropAllRolesFromDatabase</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/grantPrivilegesToRole.html">grantPrivilegesToRole</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/grantRolesToRole.html">grantRolesToRole</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/invalidateUserCache.html">invalidateUserCache</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/revokePrivilegesFromRole.html">revokePrivilegesFromRole</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/revokeRolesFromRole.html">revokeRolesFromRole</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/rolesInfo.html">rolesInfo</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/updateRole.html">updateRole</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../reference/command/nav-replication.html">Replication Commands</a><ul><li class="toctree-l4"><a class="reference internal" href="../reference/command/applyOps.html">applyOps</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/isMaster.html">isMaster</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/replSetAbortPrimaryCatchUp.html">replSetAbortPrimaryCatchUp</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/replSetFreeze.html">replSetFreeze</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/replSetGetConfig.html">replSetGetConfig</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/replSetGetStatus.html">replSetGetStatus</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/replSetInitiate.html">replSetInitiate</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/replSetMaintenance.html">replSetMaintenance</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/replSetReconfig.html">replSetReconfig</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/replSetResizeOplog.html">replSetResizeOplog</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/replSetStepDown.html">replSetStepDown</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/replSetSyncFrom.html">replSetSyncFrom</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../reference/command/nav-sharding.html">Sharding Commands</a><ul><li class="toctree-l4"><a class="reference internal" href="../reference/command/addShard.html">addShard</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/addShardToZone.html">addShardToZone</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/balancerStart.html">balancerStart</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/balancerStatus.html">balancerStatus</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/balancerStop.html">balancerStop</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/checkShardingIndex.html">checkShardingIndex</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/clearJumboFlag.html">clearJumboFlag</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/cleanupOrphaned.html">cleanupOrphaned</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/enableSharding.html">enableSharding</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/flushRouterConfig.html">flushRouterConfig</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/getShardMap.html">getShardMap</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/getShardVersion.html">getShardVersion</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/isdbgrid.html">isdbgrid</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/listShards.html">listShards</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/medianKey.html">medianKey</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/moveChunk.html">moveChunk</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/movePrimary.html">movePrimary</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/mergeChunks.html">mergeChunks</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/removeShard.html">removeShard</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/removeShardFromZone.html">removeShardFromZone</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/setShardVersion.html">setShardVersion</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/shardCollection.html">shardCollection</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/shardingState.html">shardingState</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/split.html">split</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/splitChunk.html">splitChunk</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/splitVector.html">splitVector</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/unsetSharding.html">unsetSharding</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/updateZoneKeyRange.html">updateZoneKeyRange</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../reference/command/nav-sessions.html">Sessions Commands</a><ul><li class="toctree-l4"><a class="reference internal" href="../reference/command/abortTransaction.html">abortTransaction</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/commitTransaction.html">commitTransaction</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/endSessions.html">endSessions</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/killAllSessions.html">killAllSessions</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/killAllSessionsByPattern.html">killAllSessionsByPattern</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/killSessions.html">killSessions</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/refreshSessions.html">refreshSessions</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/startSession.html">startSession</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../reference/command/nav-administration.html">Administration Commands</a><ul><li class="toctree-l4"><a class="reference internal" href="../reference/command/clean.html">clean</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/cloneCollection.html">cloneCollection</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/cloneCollectionAsCapped.html">cloneCollectionAsCapped</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/collMod.html">collMod</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/compact.html">compact</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/connPoolSync.html">connPoolSync</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/convertToCapped.html">convertToCapped</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/create.html">create</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/createIndexes.html">createIndexes</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/currentOp.html">currentOp</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/drop.html">drop</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/dropDatabase.html">dropDatabase</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/dropConnections.html">dropConnections</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/dropIndexes.html">dropIndexes</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/filemd5.html">filemd5</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/fsync.html">fsync</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/fsyncUnlock.html">fsyncUnlock</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/getParameter.html">getParameter</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/killCursors.html">killCursors</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/killOp.html">killOp</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/listCollections.html">listCollections</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/listDatabases.html">listDatabases</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/listIndexes.html">listIndexes</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/logRotate.html">logRotate</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/reIndex.html">reIndex</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/renameCollection.html">renameCollection</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/setFeatureCompatibilityVersion.html">setFeatureCompatibilityVersion</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/setParameter.html">setParameter</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/shutdown.html">shutdown</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../reference/command/nav-diagnostic.html">Diagnostic Commands</a><ul><li class="toctree-l4"><a class="reference internal" href="../reference/command/availableQueryOptions.html">availableQueryOptions</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/buildInfo.html">buildInfo</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/collStats.html">collStats</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/connPoolStats.html">connPoolStats</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/connectionStatus.html">connectionStatus</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/cursorInfo.html">cursorInfo</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/dataSize.html">dataSize</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/dbHash.html">dbHash</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/dbStats.html">dbStats</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/diagLogging.html">diagLogging</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/driverOIDTest.html">driverOIDTest</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/explain.html">explain</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/features.html">features</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/getCmdLineOpts.html">getCmdLineOpts</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/getLog.html">getLog</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/hostInfo.html">hostInfo</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/isSelf.html">isSelf</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/listCommands.html">listCommands</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/netstat.html">netstat</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/ping.html">ping</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/profile.html">profile</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/serverStatus.html">serverStatus</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/shardConnPoolStats.html">shardConnPoolStats</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/top.html">top</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/validate.html">validate</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/whatsmyuri.html">whatsmyuri</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../reference/command/nav-free-monitoring.html">Free Monitoring Commands</a><ul><li class="toctree-l4"><a class="reference internal" href="../reference/command/getFreeMonitoringStatus.html">getFreeMonitoringStatus</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/command/setFreeMonitoring.html">setFreeMonitoring</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../reference/command/nav-auditing.html">System Events Auditing Commands</a><ul><li class="toctree-l4"><a class="reference internal" href="../reference/command/logApplicationMessage.html">logApplicationMessage</a></li></ul></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../reference/method.html"><code class="docutils literal"><span class="pre">mongo</span></code> Shell Methods</a><ul><li class="toctree-l3"><a class="reference internal" href="../reference/method/js-collection.html">Collection Methods</a><ul><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.collection.aggregate.html">db.collection.aggregate()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.collection.bulkWrite.html">db.collection.bulkWrite()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.collection.copyTo.html">db.collection.copyTo()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.collection.count.html">db.collection.count()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.collection.countDocuments.html">db.collection.countDocuments()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.collection.estimatedDocumentCount.html">db.collection.estimatedDocumentCount()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.collection.createIndex.html">db.collection.createIndex()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.collection.createIndexes.html">db.collection.createIndexes()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.collection.dataSize.html">db.collection.dataSize()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.collection.deleteOne.html">db.collection.deleteOne()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.collection.deleteMany.html">db.collection.deleteMany()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.collection.distinct.html">db.collection.distinct()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.collection.drop.html">db.collection.drop()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.collection.dropIndex.html">db.collection.dropIndex()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.collection.dropIndexes.html">db.collection.dropIndexes()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.collection.ensureIndex.html">db.collection.ensureIndex()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.collection.explain.html">db.collection.explain()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.collection.find.html">db.collection.find()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.collection.findAndModify.html">db.collection.findAndModify()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.collection.findOne.html">db.collection.findOne()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.collection.findOneAndDelete.html">db.collection.findOneAndDelete()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.collection.findOneAndReplace.html">db.collection.findOneAndReplace()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.collection.findOneAndUpdate.html">db.collection.findOneAndUpdate()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.collection.getIndexes.html">db.collection.getIndexes()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.collection.getShardDistribution.html">db.collection.getShardDistribution()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.collection.getShardVersion.html">db.collection.getShardVersion()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.collection.insert.html">db.collection.insert()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.collection.insertOne.html">db.collection.insertOne()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.collection.insertMany.html">db.collection.insertMany()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.collection.isCapped.html">db.collection.isCapped()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.collection.latencyStats.html">db.collection.latencyStats()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.collection.mapReduce.html">db.collection.mapReduce()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.collection.reIndex.html">db.collection.reIndex()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.collection.remove.html">db.collection.remove()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.collection.renameCollection.html">db.collection.renameCollection()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.collection.replaceOne.html">db.collection.replaceOne()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.collection.save.html">db.collection.save()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.collection.stats.html">db.collection.stats()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.collection.storageSize.html">db.collection.storageSize()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.collection.totalIndexSize.html">db.collection.totalIndexSize()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.collection.totalSize.html">db.collection.totalSize()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.collection.update.html">db.collection.update()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.collection.updateOne.html">db.collection.updateOne()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.collection.updateMany.html">db.collection.updateMany()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.collection.watch.html">db.collection.watch()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.collection.validate.html">db.collection.validate()</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../reference/method/js-cursor.html">Cursor Methods</a><ul><li class="toctree-l4"><a class="reference internal" href="../reference/method/cursor.addOption.html">cursor.addOption()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/cursor.allowPartialResults.html">cursor.allowPartialResults()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/cursor.batchSize.html">cursor.batchSize()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/cursor.close.html">cursor.close()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/cursor.isClosed.html">cursor.isClosed()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/cursor.collation.html">cursor.collation()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/cursor.comment.html">cursor.comment()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/cursor.count.html">cursor.count()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/cursor.explain.html">cursor.explain()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/cursor.forEach.html">cursor.forEach()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/cursor.hasNext.html">cursor.hasNext()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/cursor.hint.html">cursor.hint()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/cursor.isExhausted.html">cursor.isExhausted()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/cursor.itcount.html">cursor.itcount()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/cursor.limit.html">cursor.limit()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/cursor.map.html">cursor.map()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/cursor.max.html">cursor.max()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/cursor.maxTimeMS.html">cursor.maxTimeMS()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/cursor.min.html">cursor.min()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/cursor.next.html">cursor.next()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/cursor.noCursorTimeout.html">cursor.noCursorTimeout()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/cursor.objsLeftInBatch.html">cursor.objsLeftInBatch()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/cursor.pretty.html">cursor.pretty()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/cursor.readConcern.html">cursor.readConcern()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/cursor.readPref.html">cursor.readPref()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/cursor.returnKey.html">cursor.returnKey()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/cursor.showRecordId.html">cursor.showRecordId()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/cursor.size.html">cursor.size()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/cursor.skip.html">cursor.skip()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/cursor.sort.html">cursor.sort()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/cursor.tailable.html">cursor.tailable()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/cursor.toArray.html">cursor.toArray()</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../reference/method/js-database.html">Database Methods</a><ul><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.adminCommand.html">db.adminCommand()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.aggregate.html">db.aggregate()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.cloneCollection.html">db.cloneCollection()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.cloneDatabase.html">db.cloneDatabase()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.commandHelp.html">db.commandHelp()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.copyDatabase.html">db.copyDatabase()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.createCollection.html">db.createCollection()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.createView.html">db.createView()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.currentOp.html">db.currentOp()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.dropDatabase.html">db.dropDatabase()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.eval.html">db.eval()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.fsyncLock.html">db.fsyncLock()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.fsyncUnlock.html">db.fsyncUnlock()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.getCollection.html">db.getCollection()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.getCollectionInfos.html">db.getCollectionInfos()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.getCollectionNames.html">db.getCollectionNames()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.getLastError.html">db.getLastError()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.getLastErrorObj.html">db.getLastErrorObj()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.getLogComponents.html">db.getLogComponents()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.getMongo.html">db.getMongo()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.getName.html">db.getName()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.getProfilingLevel.html">db.getProfilingLevel()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.getProfilingStatus.html">db.getProfilingStatus()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.getReplicationInfo.html">db.getReplicationInfo()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.getSiblingDB.html">db.getSiblingDB()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.help.html">db.help()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.hostInfo.html">db.hostInfo()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.isMaster.html">db.isMaster()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.killOp.html">db.killOp()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.listCommands.html">db.listCommands()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.logout.html">db.logout()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.printCollectionStats.html">db.printCollectionStats()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.printReplicationInfo.html">db.printReplicationInfo()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.printShardingStatus.html">db.printShardingStatus()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.printSlaveReplicationInfo.html">db.printSlaveReplicationInfo()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.resetError.html">db.resetError()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.runCommand.html">db.runCommand()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.serverBuildInfo.html">db.serverBuildInfo()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.serverCmdLineOpts.html">db.serverCmdLineOpts()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.serverStatus.html">db.serverStatus()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.setLogLevel.html">db.setLogLevel()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.setProfilingLevel.html">db.setProfilingLevel()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.shutdownServer.html">db.shutdownServer()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.stats.html">db.stats()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.version.html">db.version()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.watch.html">db.watch()</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../reference/method/js-plan-cache.html">Query Plan Cache Methods</a><ul><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.collection.getPlanCache.html">db.collection.getPlanCache()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/PlanCache.clear.html">PlanCache.clear()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/PlanCache.clearPlansByQuery.html">PlanCache.clearPlansByQuery()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/PlanCache.getPlansByQuery.html">PlanCache.getPlansByQuery()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/PlanCache.help.html">PlanCache.help()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/PlanCache.listQueryShapes.html">PlanCache.listQueryShapes()</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../reference/method/js-bulk.html">Bulk Operation Methods</a><ul><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.collection.initializeOrderedBulkOp.html">db.collection.initializeOrderedBulkOp()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.collection.initializeUnorderedBulkOp.html">db.collection.initializeUnorderedBulkOp()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/Bulk.html">Bulk()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/Bulk.execute.html">Bulk.execute()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/Bulk.find.html">Bulk.find()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/Bulk.find.arrayFilters.html">Bulk.find.arrayFilters()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/Bulk.find.collation.html">Bulk.find.collation()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/Bulk.find.hint.html">Bulk.find.hint()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/Bulk.find.remove.html">Bulk.find.remove()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/Bulk.find.removeOne.html">Bulk.find.removeOne()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/Bulk.find.replaceOne.html">Bulk.find.replaceOne()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/Bulk.find.updateOne.html">Bulk.find.updateOne()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/Bulk.find.update.html">Bulk.find.update()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/Bulk.find.upsert.html">Bulk.find.upsert()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/Bulk.getOperations.html">Bulk.getOperations()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/Bulk.insert.html">Bulk.insert()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/Bulk.tojson.html">Bulk.tojson()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/Bulk.toString.html">Bulk.toString()</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../reference/method/js-user-management.html">User Management Methods</a><ul><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.auth.html">db.auth()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.changeUserPassword.html">db.changeUserPassword()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.createUser.html">db.createUser()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.dropUser.html">db.dropUser()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.dropAllUsers.html">db.dropAllUsers()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.getUser.html">db.getUser()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.getUsers.html">db.getUsers()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.grantRolesToUser.html">db.grantRolesToUser()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.removeUser.html">db.removeUser()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.revokeRolesFromUser.html">db.revokeRolesFromUser()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.updateUser.html">db.updateUser()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/passwordPrompt.html">passwordPrompt()</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../reference/method/js-role-management.html">Role Management Methods</a><ul><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.createRole.html">db.createRole()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.dropRole.html">db.dropRole()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.dropAllRoles.html">db.dropAllRoles()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.getRole.html">db.getRole()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.getRoles.html">db.getRoles()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.grantPrivilegesToRole.html">db.grantPrivilegesToRole()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.revokePrivilegesFromRole.html">db.revokePrivilegesFromRole()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.grantRolesToRole.html">db.grantRolesToRole()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.revokeRolesFromRole.html">db.revokeRolesFromRole()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.updateRole.html">db.updateRole()</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../reference/method/js-replication.html">Replication Methods</a><ul><li class="toctree-l4"><a class="reference internal" href="../reference/method/rs.add.html">rs.add()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/rs.addArb.html">rs.addArb()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/rs.conf.html">rs.conf()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/rs.freeze.html">rs.freeze()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/rs.help.html">rs.help()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/rs.initiate.html">rs.initiate()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/rs.printReplicationInfo.html">rs.printReplicationInfo()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/rs.printSlaveReplicationInfo.html">rs.printSlaveReplicationInfo()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/rs.reconfig.html">rs.reconfig()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/rs.remove.html">rs.remove()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/rs.slaveOk.html">rs.slaveOk()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/rs.status.html">rs.status()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/rs.stepDown.html">rs.stepDown()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/rs.syncFrom.html">rs.syncFrom()</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../reference/method/js-sharding.html">Sharding Methods</a><ul><li class="toctree-l4"><a class="reference internal" href="../reference/method/sh.addShard.html">sh.addShard()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/sh.addShardTag.html">sh.addShardTag()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/sh.addShardToZone.html">sh.addShardToZone()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/sh.addTagRange.html">sh.addTagRange()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/sh.disableBalancing.html">sh.disableBalancing()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/sh.enableBalancing.html">sh.enableBalancing()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/sh.disableAutoSplit.html">sh.disableAutoSplit</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/sh.enableAutoSplit.html">sh.enableAutoSplit</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/sh.enableSharding.html">sh.enableSharding()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/sh.getBalancerHost.html">sh.getBalancerHost()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/sh.getBalancerState.html">sh.getBalancerState()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/sh.removeTagRange.html">sh.removeTagRange()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/sh.removeRangeFromZone.html">sh.removeRangeFromZone()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/sh.help.html">sh.help()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/sh.isBalancerRunning.html">sh.isBalancerRunning()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/sh.moveChunk.html">sh.moveChunk()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/sh.removeShardTag.html">sh.removeShardTag()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/sh.removeShardFromZone.html">sh.removeShardFromZone()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/sh.setBalancerState.html">sh.setBalancerState()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/sh.shardCollection.html">sh.shardCollection()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/sh.splitAt.html">sh.splitAt()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/sh.splitFind.html">sh.splitFind()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/sh.startBalancer.html">sh.startBalancer()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/sh.status.html">sh.status()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/sh.stopBalancer.html">sh.stopBalancer()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/sh.waitForBalancer.html">sh.waitForBalancer()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/sh.waitForBalancerOff.html">sh.waitForBalancerOff()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/sh.waitForPingChange.html">sh.waitForPingChange()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/sh.updateZoneKeyRange.html">sh.updateZoneKeyRange()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/convertShardKeyToHashed.html">convertShardKeyToHashed</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../reference/method/js-free-monitoring.html">Free Monitoring Methods</a><ul><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.disableFreeMonitoring.html">db.disableFreeMonitoring()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.enableFreeMonitoring.html">db.enableFreeMonitoring()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/db.getFreeMonitoringStatus.html">db.getFreeMonitoringStatus</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../reference/method/js-constructor.html">Object Constructors and Methods</a><ul><li class="toctree-l4"><a class="reference internal" href="../reference/method/BulkWriteResult.html">BulkWriteResult()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/Date.html">Date()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/ObjectId.html">ObjectId</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/ObjectId.getTimestamp.html">ObjectId.getTimestamp()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/ObjectId.toString.html">ObjectId.toString()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/ObjectId.valueOf.html">ObjectId.valueOf()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/UUID.html">UUID()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/WriteResult.html">WriteResult()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/WriteResult.hasWriteError.html">WriteResult.hasWriteError()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/WriteResult.hasWriteConcernError.html">WriteResult.hasWriteConcernError()</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../reference/method/js-connection.html">Connection Methods</a><ul><li class="toctree-l4"><a class="reference internal" href="../reference/method/connect.html">connect()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/Mongo.html">Mongo()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/Mongo.getDB.html">Mongo.getDB()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/Mongo.getReadPrefMode.html">Mongo.getReadPrefMode()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/Mongo.getReadPrefTagSet.html">Mongo.getReadPrefTagSet()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/Mongo.isCausalConsistency.html">Mongo.isCausalConsistency()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/Mongo.setCausalConsistency.html">Mongo.setCausalConsistency()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/Mongo.setReadPref.html">Mongo.setReadPref()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/Mongo.setSlaveOk.html">Mongo.setSlaveOk()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/Mongo.startSession.html">Mongo.startSession()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/Mongo.watch.html">Mongo.watch()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/Session.html">Session</a><ul><li class="toctree-l5"><a class="reference internal" href="../reference/method/Session.abortTransaction.html">Session.abortTransaction()</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/method/Session.commitTransaction.html">Session.commitTransaction()</a></li><li class="toctree-l5"><a class="reference internal" href="../reference/method/Session.startTransaction.html">Session.startTransaction()</a></li></ul></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/SessionOptions.html">SessionOptions</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../reference/method/js-native.html">Native Methods</a><ul><li class="toctree-l4"><a class="reference internal" href="../reference/method/cat.html">cat()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/cd.html">cd()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/copyDbpath.html">copyDbpath()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/getHostName.html">getHostName()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/getMemInfo.html">getMemInfo()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/hostname.html">hostname()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/isInteractive.html">isInteractive()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/listFiles.html">listFiles()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/load.html">load()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/ls.html">ls()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/md5sumFile.html">md5sumFile()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/mkdir.html">mkdir()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/pwd.html">pwd()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/quit.html">quit()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/removeFile.html">removeFile()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/resetDbpath.html">resetDbpath()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/sleep.html">sleep()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/setVerboseShell.html">setVerboseShell()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/version.html">version()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/isWindows.html">_isWindows()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/rand.html">_rand()</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="../reference/method/js-client-side-field-level-encryption.html">Client-Side Field Level Encryption Methods</a><ul><li class="toctree-l4"><a class="reference internal" href="../reference/method/getKeyVault.html">getKeyVault()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/KeyVault.createKey.html">KeyVault.createKey()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/KeyVault.deleteKey.html">KeyVault.deleteKey()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/KeyVault.getKey.html">KeyVault.getKey()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/KeyVault.getKeys.html">KeyVault.getKeys()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/KeyVault.addKeyAlternateName.html">KeyVault.addKeyAlternateName()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/KeyVault.removeKeyAlternateName.html">KeyVault.removeKeyAlternateName()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/KeyVault.getKeyByAltName.html">KeyVault.getKeyByAltName()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/getClientEncryption.html">getClientEncryption()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/ClientEncryption.encrypt.html">ClientEncryption.encrypt()</a></li><li class="toctree-l4"><a class="reference internal" href="../reference/method/ClientEncryption.decrypt.html">ClientEncryption.decrypt()</a></li></ul></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../reference/program.html">MongoDB Package Components</a><ul><li class="toctree-l3"><a class="reference internal" href="../reference/program/mongod.html"><code class="docutils literal"><span class="pre">mongod</span></code></a></li><li class="toctree-l3"><a class="reference internal" href="../reference/program/mongos.html"><code class="docutils literal"><span class="pre">mongos</span></code></a></li><li class="toctree-l3"><a class="reference internal" href="../reference/program/mongo.html"><code class="docutils literal"><span class="pre">mongo</span></code></a></li><li class="toctree-l3"><a class="reference internal" href="../reference/program/mongod.exe.html"><code class="docutils literal"><span class="pre">mongod.exe</span></code></a></li><li class="toctree-l3"><a class="reference internal" href="../reference/program/mongos.exe.html"><code class="docutils literal"><span class="pre">mongos.exe</span></code></a></li><li class="toctree-l3"><a class="reference internal" href="../reference/program/mongodump.html"><code class="docutils literal"><span class="pre">mongodump</span></code></a></li><li class="toctree-l3"><a class="reference internal" href="../reference/program/mongorestore.html"><code class="docutils literal"><span class="pre">mongorestore</span></code></a></li><li class="toctree-l3"><a class="reference internal" href="../reference/program/bsondump.html"><code class="docutils literal"><span class="pre">bsondump</span></code></a></li><li class="toctree-l3"><a class="reference internal" href="../reference/program/mongoimport.html"><code class="docutils literal"><span class="pre">mongoimport</span></code></a></li><li class="toctree-l3"><a class="reference internal" href="../reference/program/mongoexport.html"><code class="docutils literal"><span class="pre">mongoexport</span></code></a></li><li class="toctree-l3"><a class="reference internal" href="../reference/program/mongostat.html"><code class="docutils literal"><span class="pre">mongostat</span></code></a></li><li class="toctree-l3"><a class="reference internal" href="../reference/program/mongotop.html"><code class="docutils literal"><span class="pre">mongotop</span></code></a></li><li class="toctree-l3"><a class="reference internal" href="../reference/program/mongoreplay.html"><code class="docutils literal"><span class="pre">mongoreplay</span></code></a></li><li class="toctree-l3"><a class="reference internal" href="../reference/program/mongoldap.html"><code class="docutils literal"><span class="pre">mongoldap</span></code></a></li><li class="toctree-l3"><a class="reference internal" href="../reference/program/mongofiles.html"><code class="docutils literal"><span class="pre">mongofiles</span></code></a></li><li class="toctree-l3"><a class="reference internal" href="../reference/program/install_compass.html"><code class="docutils literal"><span class="pre">install_compass</span></code></a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../reference/configuration-options.html">Configuration File Options</a><ul><li class="toctree-l3"><a class="reference internal" href="../reference/expansion-directives.html">Externally Sourced Configuration File Values</a></li><li class="toctree-l3"><a class="reference internal" href="../tutorial/convert-command-line-options-to-yaml.html">Convert Command-Line Options to YAML</a></li><li class="toctree-l3"><a class="reference internal" href="../reference/configuration-file-settings-command-line-options-mapping.html">Configuration File Settings and Command-Line Options Mapping</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../reference/parameters.html">MongoDB Server Parameters</a></li><li class="toctree-l2"><a class="reference internal" href="../reference/limits.html">MongoDB Limits and Thresholds</a></li><li class="toctree-l2"><a class="reference internal" href="../reference/explain-results.html">Explain Results</a></li><li class="toctree-l2"><a class="reference internal" href="../reference/system-collections.html">System Collections</a></li><li class="toctree-l2"><a class="reference internal" href="../reference/connection-string.html">Connection String URI Format</a></li><li class="toctree-l2"><a class="reference internal" href="../reference/collation.html">Collation</a><ul><li class="toctree-l3"><a class="reference internal" href="../reference/collation-locales-defaults.html">Collation Locales and Default Parameters</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="../reference/mongodb-wire-protocol.html">MongoDB Wire Protocol</a></li><li class="toctree-l2"><a class="reference internal" href="../reference/log-messages.html">Log Messages</a></li><li class="toctree-l2"><a class="reference internal" href="../reference/exit-codes.html">Exit Codes and Statuses</a></li><li class="toctree-l2"><a class="reference internal" href="../reference/glossary.html">Glossary</a></li><li class="toctree-l2"><a class="reference internal" href="../reference/default-mongodb-port.html">Default MongoDB Port</a></li><li class="toctree-l2"><a class="reference internal" href="../reference/server-sessions.html">Server Sessions</a></li></ul></li><li class="toctree-l1 current"><a class="reference internal" href="../release-notes.html">Release Notes</a><ul class="current"><li class="toctree-l2 current"><a class="reference internal current" href="">Release Notes for MongoDB 4.2</a><ul><li class="toctree-l3"><a class="reference internal" href="4.2-compatibility.html">Compatibility Changes in MongoDB 4.2</a></li><li class="toctree-l3"><a class="reference internal" href="4.2-upgrade-standalone.html">Upgrade a Standalone to 4.2</a></li><li class="toctree-l3"><a class="reference internal" href="4.2-upgrade-replica-set.html">Upgrade a Replica Set to 4.2</a></li><li class="toctree-l3"><a class="reference internal" href="4.2-upgrade-sharded-cluster.html">Upgrade a Sharded Cluster to 4.2</a></li><li class="toctree-l3"><a class="reference internal" href="4.2-downgrade.html">Downgrade 4.2 to 4.0</a><ul><li class="toctree-l4"><a class="reference internal" href="4.2-downgrade-standalone.html">Downgrade 4.2 Standalone to 4.0</a></li><li class="toctree-l4"><a class="reference internal" href="4.2-downgrade-replica-set.html">Downgrade 4.2 Replica Set to 4.0</a></li><li class="toctree-l4"><a class="reference internal" href="4.2-downgrade-sharded-cluster.html">Downgrade 4.2 Sharded Cluster to 4.0</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="4.2-changelog.html">4.2 Changelog</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="4.0.html">Release Notes for MongoDB 4.0</a><ul><li class="toctree-l3"><a class="reference internal" href="4.0-compatibility.html">Compatibility Changes in MongoDB 4.0</a></li><li class="toctree-l3"><a class="reference internal" href="4.0-upgrade-standalone.html">Upgrade a Standalone to 4.0</a></li><li class="toctree-l3"><a class="reference internal" href="4.0-upgrade-replica-set.html">Upgrade a Replica Set to 4.0</a></li><li class="toctree-l3"><a class="reference internal" href="4.0-upgrade-sharded-cluster.html">Upgrade a Sharded Cluster to 4.0</a></li><li class="toctree-l3"><a class="reference internal" href="4.0-downgrade-standalone.html">Downgrade 4.0 Standalone to 3.6</a></li><li class="toctree-l3"><a class="reference internal" href="4.0-downgrade-replica-set.html">Downgrade 4.0 Replica Set to 3.6</a></li><li class="toctree-l3"><a class="reference internal" href="4.0-downgrade-sharded-cluster.html">Downgrade 4.0 Sharded Cluster to 3.6</a></li><li class="toctree-l3"><a class="reference internal" href="4.0-changelog.html">4.0 Changelog</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="3.6.html">Release Notes for MongoDB 3.6</a><ul><li class="toctree-l3"><a class="reference internal" href="3.6-changelog.html">3.6 Changelog</a></li><li class="toctree-l3"><a class="reference internal" href="3.6-compatibility.html">Compatibility Changes in MongoDB 3.6</a></li><li class="toctree-l3"><a class="reference internal" href="3.6-upgrade-standalone.html">Upgrade a Standalone to 3.6</a></li><li class="toctree-l3"><a class="reference internal" href="3.6-upgrade-replica-set.html">Upgrade a Replica Set to 3.6</a></li><li class="toctree-l3"><a class="reference internal" href="3.6-upgrade-sharded-cluster.html">Upgrade a Sharded Cluster to 3.6</a></li><li class="toctree-l3"><a class="reference internal" href="3.6-downgrade-standalone.html">Downgrade 3.6 Standalone to 3.4</a></li><li class="toctree-l3"><a class="reference internal" href="3.6-downgrade-replica-set.html">Downgrade 3.6 Replica Set to 3.4</a></li><li class="toctree-l3"><a class="reference internal" href="3.6-downgrade-sharded-cluster.html">Downgrade 3.6 Sharded Cluster to 3.4</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="3.4.html">Release Notes for MongoDB 3.4</a><ul><li class="toctree-l3"><a class="reference internal" href="3.4-changelog.html">3.4 Changelog</a></li><li class="toctree-l3"><a class="reference internal" href="3.4-compatibility.html">Compatibility Changes in MongoDB 3.4</a></li><li class="toctree-l3"><a class="reference internal" href="3.4-upgrade-standalone.html">Upgrade a Standalone to 3.4</a></li><li class="toctree-l3"><a class="reference internal" href="3.4-upgrade-replica-set.html">Upgrade a Replica Set to 3.4</a></li><li class="toctree-l3"><a class="reference internal" href="3.4-upgrade-sharded-cluster.html">Upgrade a Sharded Cluster to 3.4</a></li><li class="toctree-l3"><a class="reference internal" href="3.4-downgrade.html">Downgrade MongoDB 3.4 to 3.2</a><ul><li class="toctree-l4"><a class="reference internal" href="3.4-downgrade-standalone.html">Downgrade 3.4 Standalone to 3.2</a></li><li class="toctree-l4"><a class="reference internal" href="3.4-downgrade-replica-set.html">Downgrade 3.4 Replica Set to 3.2</a></li><li class="toctree-l4"><a class="reference internal" href="3.4-downgrade-sharded-cluster.html">Downgrade 3.4 Sharded Cluster to 3.2</a></li></ul></li></ul></li><li class="toctree-l2"><a class="reference internal" href="3.2.html">Release Notes for MongoDB 3.2</a><ul><li class="toctree-l3"><a class="reference internal" href="3.2-changelog.html">3.2 Changelog</a></li><li class="toctree-l3"><a class="reference internal" href="3.2-compatibility.html">Compatibility Changes in MongoDB 3.2</a><ul><li class="toctree-l4"><a class="reference internal" href="3.2-javascript.html">JavaScript Changes in MongoDB 3.2</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="3.2-upgrade.html">Upgrade MongoDB to 3.2</a></li><li class="toctree-l3"><a class="reference internal" href="3.2-downgrade.html">Downgrade MongoDB from 3.2</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="3.0.html">Release Notes for MongoDB 3.0</a><ul><li class="toctree-l3"><a class="reference internal" href="3.0-changelog.html">3.0 Changelog</a></li><li class="toctree-l3"><a class="reference internal" href="3.0-compatibility.html">Compatibility Changes in MongoDB 3.0</a></li><li class="toctree-l3"><a class="reference internal" href="3.0-upgrade.html">Upgrade MongoDB to 3.0</a></li><li class="toctree-l3"><a class="reference internal" href="3.0-scram.html">Upgrade to SCRAM</a></li><li class="toctree-l3"><a class="reference internal" href="3.0-downgrade.html">Downgrade MongoDB from 3.0</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="2.6.html">Release Notes for MongoDB 2.6</a><ul><li class="toctree-l3"><a class="reference internal" href="2.6-changelog.html">2.6 Changelog</a></li><li class="toctree-l3"><a class="reference internal" href="2.6-compatibility.html">Compatibility Changes in MongoDB 2.6</a></li><li class="toctree-l3"><a class="reference internal" href="2.6-upgrade.html">Upgrade MongoDB to 2.6</a></li><li class="toctree-l3"><a class="reference internal" href="2.6-upgrade-authorization.html">Upgrade User Authorization Data to 2.6 Format</a></li><li class="toctree-l3"><a class="reference internal" href="2.6-downgrade.html">Downgrade MongoDB from 2.6</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="2.4.html">Release Notes for MongoDB 2.4</a><ul><li class="toctree-l3"><a class="reference internal" href="2.4-changelog.html">2.4 Changelog</a></li><li class="toctree-l3"><a class="reference internal" href="2.4-javascript.html">JavaScript Changes in MongoDB 2.4</a></li><li class="toctree-l3"><a class="reference internal" href="2.4-upgrade.html">Upgrade MongoDB to 2.4</a></li><li class="toctree-l3"><a class="reference internal" href="2.4-index-types.html">Compatibility and Index Type Changes in MongoDB 2.4</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="2.2.html">Release Notes for MongoDB 2.2</a></li><li class="toctree-l2"><a class="reference internal" href="2.0.html">Release Notes for MongoDB 2.0</a></li><li class="toctree-l2"><a class="reference internal" href="1.8.html">Release Notes for MongoDB 1.8</a></li><li class="toctree-l2"><a class="reference internal" href="1.6.html">Release Notes for MongoDB 1.6</a></li><li class="toctree-l2"><a class="reference internal" href="1.4.html">Release Notes for MongoDB 1.4</a></li><li class="toctree-l2"><a class="reference internal" href="1.2.html">Release Notes for MongoDB 1.2.x</a></li><li class="toctree-l2"><a class="reference internal" href="../reference/versioning.html">MongoDB Versioning</a></li></ul></li><li class="toctree-l1"><a class="reference internal" href="../support.html">Technical Support</a></li></ul>


    </div>
  </div>
           
         </aside>

   </div>

    <div id="main-column" class="main-column">

    <span id="showNav" class="showNav">Navigation</span>

      
        <div class="document">
            <div class="documentwrapper"><div class="bodywrapper">
              <div class="body" data-pagename="release-notes/4.2">
                   <a class="edit-link" href="https://github.com/mongodb/docs/blob/v4.2/source/release-notes/4.2.txt" target="_blank" title="Edit release-notes/4.2.txt on GitHub">
    
      <span class="icon-edit"></span>
    
  </a>
                

                
  <div class="bc">
    
      <ul>
          <li><a href="../release-notes.html">Release Notes</a><span class="bcpoint"> > </span></li>
            <li>Release Notes for MongoDB 4.2</li> 
      </ul>
    
    
  </div>
                
                  <div class="section" id="release-notes-for-mongodb-4-2">
<h1>Release Notes for MongoDB 4.2<a class="headerlink" href="#release-notes-for-mongodb-4-2" title="Permalink to this headline">¶</a></h1>
<div class="section" id="mongodb-4-2-released-aug-13-2019">
<h2>MongoDB 4.2 Released Aug 13, 2019<a class="headerlink" href="#mongodb-4-2-released-aug-13-2019" title="Permalink to this headline">¶</a></h2>
<div class="contents twocols local topic" id="on-this-page">
<p class="topic-title first">On this page</p>
<ul class="simple">
<li><a class="reference internal" href="#minor-releases" id="id11">Minor Releases</a></li>
<li><a class="reference internal" href="#distributed-transactions" id="id12">Distributed Transactions</a></li>
<li><a class="reference internal" href="#removed-mmapv1-storage-engine" id="id13">Removed MMAPv1 Storage Engine</a></li>
<li><a class="reference internal" href="#removed-commands-and-methods" id="id14">Removed Commands and Methods</a></li>
<li><a class="reference internal" href="#mongodb-drivers" id="id15">MongoDB Drivers</a></li>
<li><a class="reference internal" href="#sharded-clusters" id="id16">Sharded Clusters</a></li>
<li><a class="reference internal" href="#security-improvements" id="id17">Security Improvements</a></li>
<li><a class="reference internal" href="#aggregation-improvements" id="id18">Aggregation Improvements</a></li>
<li><a class="reference internal" href="#change-stream" id="id19">Change Stream</a></li>
<li><a class="reference internal" href="#update-enhancements" id="id20">Update Enhancements</a></li>
<li><a class="reference internal" href="#wildcard-indexes" id="id21">Wildcard Indexes</a></li>
<li><a class="reference internal" href="#platform-support" id="id22">Platform Support</a></li>
<li><a class="reference internal" href="#mongodb-tools" id="id23">MongoDB Tools</a></li>
<li><a class="reference internal" href="#monitoring" id="id24">Monitoring</a></li>
<li><a class="reference internal" href="#flow-control" id="id25">Flow Control</a></li>
<li><a class="reference internal" href="#logging-and-diagnostics" id="id26">Logging and Diagnostics</a></li>
<li><a class="reference internal" href="#general-improvements" id="id27">General Improvements</a></li>
<li><a class="reference internal" href="#query-plan-improvements" id="id28">Query Plan Improvements</a></li>
<li><a class="reference internal" href="#optimized-index-builds" id="id29">Optimized Index Builds</a></li>
<li><a class="reference internal" href="#changes-affecting-compatibility" id="id30">Changes Affecting Compatibility</a></li>
<li><a class="reference internal" href="#upgrade-procedures" id="id31">Upgrade Procedures</a></li>
<li><a class="reference internal" href="#download" id="id32">Download</a></li>
<li><a class="reference internal" href="#known-issues" id="id33">Known Issues</a></li>
<li><a class="reference internal" href="#report-an-issue" id="id34">Report an Issue</a></li>
</ul>
</div>
<div class="section" id="minor-releases">
<h3>Minor Releases<a class="headerlink" href="#minor-releases" title="Permalink to this headline">¶</a></h3>
<div class="section" id="upcoming">
<span id="release-notes"></span><h4>4.2.6 - Upcoming<a class="headerlink" href="#upcoming" title="Permalink to this headline">¶</a></h4>
<p>Issues fixed in 4.2.6:</p>
<ul class="simple">
<li><a class="reference external" href="https://jira.mongodb.org/browse/SERVER-45119">SERVER-45119</a>: CollectionShardingState::getCurrentShardVersionIfKnown returns collection version instead of shard version</li>
<li><a class="reference external" href="https://jira.mongodb.org/browse/SERVER-44892">SERVER-44892</a>: getShardDistribution should use $collStats agg stage instead of collStats command</li>
<li><a class="reference external" href="https://jira.mongodb.org/browse/SERVER-43848">SERVER-43848</a>: find/update/delete w/o shard key predicate under txn with snapshot read can miss documents</li>
<li><a class="reference external" href="https://jira.mongodb.org/browse/SERVER-42827">SERVER-42827</a>: Allow sessions collection to return OK for creating indexes if at least one shard returns OK and others return CannotImplicitlyCreateCollection</li>
<li><a class="reference external" href="https://jira.mongodb.org/browse/SERVER-40805">SERVER-40805</a>: Indicate the reason for replanning in the log file</li>
<li><a class="reference external" href="https://jira.mongodb.org/browse/SERVER-45389">SERVER-45389</a>: Add metrics tracking how often shards have inconsistent indexes</li>
<li><a class="reference external" href="https://jira.mongodb.org/browse/SERVER-44689">SERVER-44689</a>: Add serverStatus counter for each use of an aggregation stage in a user’s request</li>
<li><a class="reference external" href="https://jira.mongodb.org/issues/?jql=project%20in%20(SERVER%2CTOOLS%2CWT)%20AND%20resolution%3D%27Fixed%27%20and%20fixversion%3D%274.2.6%27">All JIRA issues closed in 4.2.6</a></li>
<li><a class="reference internal" href="4.2-changelog.html#id1"><span class="std std-ref">4.2.6 Changelog</span></a></li>
</ul>
</div>
<div class="section" id="mar-26-2020">
<span id="id1"></span><h4>4.2.5 - Mar 26, 2020<a class="headerlink" href="#mar-26-2020" title="Permalink to this headline">¶</a></h4>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">The release of version 4.2.4 was skipped due to an issue
encountered during the release. However, the 4.2.5 release includes
the fixes made in 4.2.4.</p>
</div>
<p>Issues fixed in 4.2.5:</p>
<ul class="simple">
<li><a class="reference external" href="https://jira.mongodb.org/browse/SERVER-45770">SERVER-45770</a>: Add to information contained in logfile about “moveChunk.to”</li>
<li><a class="reference external" href="https://jira.mongodb.org/issues/?jql=project%20in%20(SERVER%2CTOOLS%2CWT)%20AND%20resolution%3D%27Fixed%27%20and%20fixversion%3D%274.2.5%27">All JIRA issues closed in 4.2.5</a></li>
<li><a class="reference internal" href="4.2-changelog.html#id3"><span class="std std-ref">4.2.5 Changelog</span></a></li>
</ul>
<p>Issues fixed in 4.2.4:</p>
<ul class="simple">
<li><a class="reference external" href="https://jira.mongodb.org/browse/SERVER-44915">SERVER-44915</a>: Extend $indexStats output to include full index options and shard name</li>
<li><a class="reference external" href="https://jira.mongodb.org/browse/SERVER-46121">SERVER-46121</a>: mongos crashes with invariant error after changing taskExecutorPoolSize</li>
<li><a class="reference external" href="https://jira.mongodb.org/browse/SERVER-45137">SERVER-45137</a>: Increasing memory allocation in Top::record with high rate of collection creates and drops</li>
<li><a class="reference external" href="https://jira.mongodb.org/browse/SERVER-44904">SERVER-44904</a>: Startup recovery should not delete corrupt documents while rebuilding unfinished indexes</li>
<li><a class="reference external" href="https://jira.mongodb.org/browse/SERVER-44260">SERVER-44260</a>: Transaction can conflict with previous transaction on the session if the all committed point is held back</li>
<li><a class="reference external" href="https://jira.mongodb.org/browse/SERVER-35050">SERVER-35050</a>: Don’t abort collection clone due to negative document count</li>
<li><a class="reference external" href="https://jira.mongodb.org/browse/SERVER-39112">SERVER-39112</a>: Primary drain mode can be unnecessarily slow</li>
<li><a class="reference external" href="https://jira.mongodb.org/issues/?jql=project%20in%20(SERVER%2CTOOLS%2CWT)%20AND%20resolution%3D%27Fixed%27%20and%20fixversion%3D%274.2.4%27">All JIRA issues closed in 4.2.4</a></li>
<li><a class="reference internal" href="4.2-changelog.html#id9"><span class="std std-ref">4.2.4 Changelog</span></a></li>
</ul>
</div>
<div class="section" id="jan-27-2020">
<span id="id2"></span><h4>4.2.3 - Jan 27, 2020<a class="headerlink" href="#jan-27-2020" title="Permalink to this headline">¶</a></h4>
<p>Issues fixed:</p>
<ul class="simple">
<li><a class="reference external" href="https://jira.mongodb.org/browse/SERVER-42565">SERVER-42565</a>: Aggregations and find commands sort missing fields differently’</li>
<li><a class="reference external" href="https://jira.mongodb.org/browse/SERVER-44174">SERVER-44174</a>: $push and $addToSet should restrict memory usage</li>
<li><a class="reference external" href="https://jira.mongodb.org/browse/SERVER-40435">SERVER-40435</a>: A clearJumboFlag command to clear the jumbo flag</li>
<li><a class="reference external" href="https://jira.mongodb.org/browse/SERVER-45270">SERVER-45270</a>: Increased vulnerability to slow DNS</li>
<li><a class="reference external" href="https://jira.mongodb.org/browse/TOOLS-1952">TOOLS-1952</a>: Use –forceTableScan by default when running against WiredTiger nodes</li>
<li><a class="reference external" href="https://jira.mongodb.org/browse/TOOLS-2453">TOOLS-2453</a>: Index keys not escaped correctly</li>
<li><a class="reference external" href="https://jira.mongodb.org/browse/SERVER-45396">SERVER-45396</a>: fix the “me” field in isMaster responses when using splithorizon</li>
<li><a class="reference external" href="https://jira.mongodb.org/browse/SERVER-45309">SERVER-45309</a>: Ensure bind credentials live longer than LDAP operations</li>
<li><a class="reference external" href="https://jira.mongodb.org/browse/WT-5120">WT-5120</a>: Checkpoint hangs when reconciliation doesn’t release the eviction generation</li>
<li><a class="reference external" href="https://jira.mongodb.org/issues/?jql=project%20in%20(SERVER%2CTOOLS%2CWT)%20AND%20resolution%3D%27Fixed%27%20and%20fixversion%3D%274.2.3%27">All JIRA issues closed in 4.2.3</a></li>
<li><a class="reference internal" href="4.2-changelog.html#id20"><span class="std std-ref">4.2.3 Changelog</span></a></li>
</ul>
</div>
<div class="section" id="dec-9-2019">
<span id="id3"></span><h4>4.2.2 - Dec 9, 2019<a class="headerlink" href="#dec-9-2019" title="Permalink to this headline">¶</a></h4>
<p>Issues fixed:</p>
<ul class="simple">
<li><a class="reference external" href="https://jira.mongodb.org/browse/SERVER-31083">SERVER-31083</a>: Allow passing primary shard to “enableSharding” command for a new database</li>
<li><a class="reference external" href="https://jira.mongodb.org/browse/SERVER-33272">SERVER-33272</a>: The DatabaseHolder::close() function no longer requires a global write lock and neither does the dropDatabase command</li>
<li><a class="reference external" href="https://jira.mongodb.org/browse/SERVER-44050">SERVER-44050</a>: Arrays along ‘hashed’ index key path are not correctly rejected</li>
<li><a class="reference external" href="https://jira.mongodb.org/browse/SERVER-43882">SERVER-43882</a>: Building indexes for startup recovery uses unowned RecordData after yielding its cursor</li>
<li><a class="reference external" href="https://jira.mongodb.org/browse/SERVER-44617">SERVER-44617</a>: $regexFind crash when one of the capture group doesn’t match the input but pattern matches</li>
<li><a class="reference external" href="https://jira.mongodb.org/browse/SERVER-44721">SERVER-44721</a>: Shell KMS AWS support cannot decrypt responses</li>
<li><a class="reference external" href="https://jira.mongodb.org/browse/SERVER-43860">SERVER-43860</a>: Pipeline style update in $merge can produce unexpected result</li>
<li><a class="reference external" href="https://jira.mongodb.org/browse/WT-4961">WT-4961</a>: Checkpoints with cache overflow must keep history for reads</li>
<li><a class="reference external" href="https://jira.mongodb.org/issues/?jql=project%20in%20(SERVER%2CTOOLS%2CWT)%20AND%20resolution%3D%27Fixed%27%20and%20fixversion%3D%274.2.2%27">All JIRA issues closed in 4.2.2</a></li>
<li><a class="reference internal" href="4.2-changelog.html#id32"><span class="std std-ref">4.2.2 Changelog</span></a></li>
</ul>
</div>
<div class="section" id="oct-18-2019">
<span id="id4"></span><h4>4.2.1 - Oct 18, 2019<a class="headerlink" href="#oct-18-2019" title="Permalink to this headline">¶</a></h4>
<p>Issues fixed:</p>
<ul class="simple">
<li><a class="reference external" href="https://jira.mongodb.org/browse/SERVER-37768">SERVER-37768</a>: Platform Support: Add Community &amp; Enterprise Debian 10 x64</li>
<li><a class="reference external" href="https://jira.mongodb.org/browse/SERVER-37772">SERVER-37772</a>: Platform Support: Add Community &amp; Enterprise RHEL 8 x64</li>
<li><a class="reference external" href="https://jira.mongodb.org/browse/SERVER-41506">SERVER-41506</a>: Track metrics associated with a node calling an election</li>
<li><a class="reference external" href="https://jira.mongodb.org/browse/SERVER-41499">SERVER-41499</a>: Track number of elections called for each reason in serverStatus</li>
<li><a class="reference external" href="https://jira.mongodb.org/browse/SERVER-42518">SERVER-42518</a>: Wildcard index plans miss results when the query path has multiple subsequent array indexes</li>
<li><a class="reference external" href="https://jira.mongodb.org/browse/SERVER-42856">SERVER-42856</a>: Transactions with write can be sent to the wrong shard</li>
<li><a class="reference external" href="https://jira.mongodb.org/issues/?jql=project%20in%20(SERVER%2CTOOLS%2CWT)%20AND%20resolution%3D%27Fixed%27%20and%20fixversion%3D%274.2.1%27">All JIRA issues closed in 4.2.1</a></li>
<li><a class="reference internal" href="4.2-changelog.html#id45"><span class="std std-ref">4.2.1 Changelog</span></a></li>
</ul>
</div>
</div>
<div class="section" id="distributed-transactions">
<span id="distributed-txns"></span><h3>Distributed Transactions<a class="headerlink" href="#distributed-transactions" title="Permalink to this headline">¶</a></h3>
<div class="topic">
<p class="topic-title first">Distributed Transactions and Multi-Document Transactions</p>
<p>Starting in MongoDB 4.2, the two terms are synonymous. Distributed
transactions refer to multi-document transactions on sharded
clusters and replica sets. Multi-document transactions (whether on
sharded clusters or replica sets) are also known as distributed
transactions starting in MongoDB 4.2.</p>
</div>
<p>In version 4.2, MongoDB introduces distributed transactions.
Distributed transactions:</p>
<ul class="simple">
<li>Adds support for multi-document transactions on sharded clusters.<ul>
<li>All members of the 4.2 sharded clusters must have
<a class="reference internal" href="../reference/command/setFeatureCompatibilityVersion.html#view-fcv"><span class="std std-ref">featureCompatibilityVersion</span></a> of <code class="docutils literal"><span class="pre">4.2</span></code>.</li>
<li>Clients <strong class="text-danger">must</strong> use MongoDB drivers updated for MongoDB 4.2</li>
</ul>
</li>
<li>Incorporates the existing support for transactions on replica sets.<ul>
<li>All members of the 4.2 replica set must have
<a class="reference internal" href="../reference/command/setFeatureCompatibilityVersion.html#view-fcv"><span class="std std-ref">featureCompatibilityVersion</span></a> of <code class="docutils literal"><span class="pre">4.2</span></code>.</li>
<li>Clients <strong class="text-danger">must</strong> use MongoDB drivers updated for MongoDB 4.2</li>
</ul>
</li>
<li>Removes the 16MB total size limit for a transaction. In version
4.2, MongoDB creates as many oplog entries (maximum size <code class="docutils literal"><span class="pre">16MB</span></code>
each) as necessary to the encapsulate all write operations in a
transaction. In MongoDB 4.0, MongoDB creates a single entry for
all write operations in a transaction, thereby imposing a 16MB
total size limit for a transaction.</li>
<li>Extends transaction support to deployments whose secondary members
use the <a class="reference internal" href="../core/inmemory.html"><span class="doc">in-memory storage engine</span></a>. That is,
transactions are available for deployments that use the WiredTiger
storage engine for the primary and either the WiredTiger or the
<a class="reference internal" href="../core/inmemory.html"><span class="doc">in-memory</span></a> storage engine for the secondary
members. In MongoDB 4.0, transactions are available for deployments
that use the WiredTiger storage engine only.</li>
</ul>
<p>For more information, see <a class="reference internal" href="../core/transactions.html"><span class="doc">Transactions</span></a>.</p>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="4.2-compatibility.html#compatibility-txn"><span class="std std-ref">4.2 Transaction Compatibility Changes</span></a></p>
</div>
</div>
<div class="section" id="removed-mmapv1-storage-engine">
<h3>Removed MMAPv1 Storage Engine<a class="headerlink" href="#removed-mmapv1-storage-engine" title="Permalink to this headline">¶</a></h3>
<p>MongoDB 4.2 removes the deprecated MMAPv1 storage engine.</p>
<p>If your 4.0 deployment uses MMAPv1, you must change the deployment to
<a class="reference internal" href="../core/wiredtiger.html"><span class="doc">WiredTiger Storage Engine</span></a> before upgrading to MongoDB 4.2. For details,
see:</p>
<ul class="simple">
<li><a class="reference internal" href="../tutorial/change-standalone-wiredtiger.html"><span class="doc">Change Standalone to WiredTiger</span></a></li>
<li><a class="reference internal" href="../tutorial/change-replica-set-wiredtiger.html"><span class="doc">Change Replica Set to WiredTiger</span></a></li>
<li><a class="reference internal" href="../tutorial/change-sharded-cluster-wiredtiger.html"><span class="doc">Change Sharded Cluster to WiredTiger</span></a></li>
</ul>
<div class="section" id="mmapv1-specific-configuration-options">
<span id="mmapv1-conf-options"></span><h4>MMAPv1 Specific Configuration Options<a class="headerlink" href="#mmapv1-specific-configuration-options" title="Permalink to this headline">¶</a></h4>
<p>MongoDB removes the following MMAPv1 specific configuration
options:</p>
<table border="1" class="colwidths-given border-table docutils">
<colgroup>
<col width="55%" />
<col width="45%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Removed Configuration File Setting</th>
<th class="head">Removed Command-line Option</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><code class="docutils literal"><span class="pre">storage.mmapv1.journal.commitIntervalMs</span></code></td>
<td>&#160;</td>
</tr>
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">storage.mmapv1.journal.debugFlags</span></code></td>
<td><code class="docutils literal"><span class="pre">mongod</span> <span class="pre">--journalOptions</span></code></td>
</tr>
<tr class="row-even"><td><code class="docutils literal"><span class="pre">storage.mmapv1.nsSize</span></code></td>
<td><code class="docutils literal"><span class="pre">mongod</span> <span class="pre">--nssize</span></code></td>
</tr>
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">storage.mmapv1.preallocDataFiles</span></code></td>
<td><code class="docutils literal"><span class="pre">mongod</span> <span class="pre">--noprealloc</span></code></td>
</tr>
<tr class="row-even"><td><code class="docutils literal"><span class="pre">storage.mmapv1.quota.enforced</span></code></td>
<td><code class="docutils literal"><span class="pre">mongod</span> <span class="pre">--quota</span></code></td>
</tr>
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">storage.mmapv1.quota.maxFilesPerDB</span></code></td>
<td><code class="docutils literal"><span class="pre">mongod</span> <span class="pre">--quotaFiles</span></code></td>
</tr>
<tr class="row-even"><td><code class="docutils literal"><span class="pre">storage.mmapv1.smallFiles</span></code></td>
<td><code class="docutils literal"><span class="pre">mongod</span> <span class="pre">--smallfiles</span></code></td>
</tr>
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">storage.repairPath</span></code></td>
<td><code class="docutils literal"><span class="pre">mongod</span> <span class="pre">--repairpath</span></code></td>
</tr>
<tr class="row-even"><td><code class="docutils literal"><span class="pre">replication.secondaryIndexPrefetch</span></code></td>
<td><code class="docutils literal"><span class="pre">mongod</span> <span class="pre">--replIndexPrefetch</span></code></td>
</tr>
</tbody>
</table>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Starting in version 4.2, MongoDB processes will not start with
these options. Remove any MMAPv1 specific configuration
options if using a WiredTiger deployment.</p>
</div>
</div>
<div class="section" id="mmapv1-specific-parameters">
<h4>MMAPv1 Specific Parameters<a class="headerlink" href="#mmapv1-specific-parameters" title="Permalink to this headline">¶</a></h4>
<p>MongoDB removes the following MMAPv1 parameters:</p>
<ul class="simple">
<li><code class="docutils literal"><span class="pre">newCollectionsUsePowerOf2Sizes</span></code></li>
<li><code class="docutils literal"><span class="pre">replIndexPrefetch</span></code></li>
</ul>
</div>
<div class="section" id="mmapv1-specific-command">
<h4>MMAPv1 Specific Command<a class="headerlink" href="#mmapv1-specific-command" title="Permalink to this headline">¶</a></h4>
<p>MongoDB removes the MMAPv1 specific <code class="docutils literal"><span class="pre">touch</span></code> command.</p>
</div>
<div class="section" id="mmapv1-specific-options-for-binaries-commands-and-methods">
<h4>MMAPv1 Specific Options for Binaries, Commands and Methods<a class="headerlink" href="#mmapv1-specific-options-for-binaries-commands-and-methods" title="Permalink to this headline">¶</a></h4>
<p>MongoDB removes the MMAPv1 specific options:</p>
<ul class="simple">
<li><code class="docutils literal"><span class="pre">noPadding</span></code> and <code class="docutils literal"><span class="pre">usePowerOf2Sizes</span></code> for <a class="reference internal" href="../reference/command/collMod.html#dbcmd.collMod" title="collMod"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">collMod</span></code></a></li>
<li><code class="docutils literal"><span class="pre">verbose</span></code> for <a class="reference internal" href="../reference/command/collStats.html#dbcmd.collStats" title="collStats"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">collStats</span></code></a></li>
<li><code class="docutils literal"><span class="pre">flags</span></code> for <a class="reference internal" href="../reference/command/create.html#dbcmd.create" title="create"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">create</span></code></a></li>
<li><code class="docutils literal"><span class="pre">paddingFactor</span></code>, <code class="docutils literal"><span class="pre">paddingBytes</span></code>, <code class="docutils literal"><span class="pre">preservePadding</span></code> for the
<a class="reference internal" href="../reference/method/db.createCollection.html#db.createCollection" title="db.createCollection()"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">db.createCollection()</span></code></a> method and the <a class="reference internal" href="../reference/command/compact.html#dbcmd.compact" title="compact"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">compact</span></code></a>
command.</li>
<li><code class="docutils literal"><span class="pre">repair</span></code> for <a class="reference internal" href="../reference/program/mongodump.html#bin.mongodump" title="bin.mongodump"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongodump</span></code></a></li>
</ul>
</div>
</div>
<div class="section" id="removed-commands-and-methods">
<h3>Removed Commands and Methods<a class="headerlink" href="#removed-commands-and-methods" title="Permalink to this headline">¶</a></h3>
<table border="1" class="docutils">
<colgroup>
<col width="33%" />
<col width="33%" />
<col width="33%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Removed Command</th>
<th class="head">Removed Method</th>
<th class="head">Notes</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><code class="docutils literal"><span class="pre">group</span></code></td>
<td><code class="docutils literal"><span class="pre">db.collection.group()</span></code></td>
<td>Use <a class="reference internal" href="../reference/method/db.collection.aggregate.html#db.collection.aggregate" title="db.collection.aggregate()"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">db.collection.aggregate()</span></code></a> with the
<a class="reference internal" href="../reference/operator/aggregation/group.html#pipe._S_group" title="$group"><code class="xref mongodb mongodb-pipeline docutils literal"><span class="pre">$group</span></code></a> stage instead.</td>
</tr>
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">eval</span></code></td>
<td>&#160;</td>
<td>The MongoDB 4.2 <a class="reference internal" href="../reference/program/mongo.html#bin.mongo" title="bin.mongo"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongo</span></code></a> shell methods
<a class="reference internal" href="../reference/method/db.eval.html#db.eval" title="db.eval()"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">db.eval()</span></code></a> and <a class="reference internal" href="../reference/method/db.collection.copyTo.html#db.collection.copyTo" title="db.collection.copyTo()"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">db.collection.copyTo()</span></code></a> can
only be run when connected to MongoDB 4.0 or earlier.</td>
</tr>
<tr class="row-even"><td><code class="docutils literal"><span class="pre">copydb</span></code></td>
<td>&#160;</td>
<td><p class="first">The corresponding <a class="reference internal" href="../reference/program/mongo.html#bin.mongo" title="bin.mongo"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongo</span></code></a> shell helpers
<code class="docutils literal"><span class="pre">db.copyDatabase()</span></code> can only be run when connected to MongoDB
4.0 or earlier.</p>
<p class="last">As an alternative, users can use <a class="reference internal" href="../reference/program/mongodump.html#bin.mongodump" title="bin.mongodump"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongodump</span></code></a> and
<a class="reference internal" href="../reference/program/mongorestore.html#bin.mongorestore" title="bin.mongorestore"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongorestore</span></code></a> (see
<a class="reference internal" href="../reference/program/mongodump.html#mongodump-example-copy-clone-database"><span class="std std-ref">Copy/Clone a Database</span></a>) or write a script
using the drivers.</p>
</td>
</tr>
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">clone</span></code></td>
<td>&#160;</td>
<td><p class="first">The corresponding <a class="reference internal" href="../reference/program/mongo.html#bin.mongo" title="bin.mongo"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongo</span></code></a> shell helpers
<code class="docutils literal"><span class="pre">db.cloneDatabase()</span></code> can only be run when connected to MongoDB
4.0 or earlier.</p>
<p class="last">As an alternative, users can use <a class="reference internal" href="../reference/program/mongodump.html#bin.mongodump" title="bin.mongodump"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongodump</span></code></a> and
<a class="reference internal" href="../reference/program/mongorestore.html#bin.mongorestore" title="bin.mongorestore"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongorestore</span></code></a> (see
<a class="reference internal" href="../reference/program/mongodump.html#mongodump-example-copy-clone-database"><span class="std std-ref">Copy/Clone a Database</span></a>) or write a script
using the drivers.</p>
</td>
</tr>
<tr class="row-even"><td><code class="docutils literal"><span class="pre">geoNear</span></code></td>
<td>&#160;</td>
<td><p class="first">Use <a class="reference internal" href="../reference/method/db.collection.aggregate.html#db.collection.aggregate" title="db.collection.aggregate()"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">db.collection.aggregate()</span></code></a> with the
<a class="reference internal" href="../reference/operator/aggregation/geoNear.html#pipe._S_geoNear" title="$geoNear"><code class="xref mongodb mongodb-pipeline docutils literal"><span class="pre">$geoNear</span></code></a> stage instead.</p>
<p class="last">For more information, see <a class="reference internal" href="4.2-compatibility.html#compat-remove-geonear"><span class="std std-ref">Remove Support for the geoNear Command</span></a>.</p>
</td>
</tr>
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">parallelCollectionScan</span></code></td>
<td>&#160;</td>
<td>&#160;</td>
</tr>
<tr class="row-even"><td><code class="docutils literal"><span class="pre">repairDatabase</span></code></td>
<td><code class="docutils literal"><span class="pre">db.repairDatabase()</span></code></td>
<td>For more information, see <a class="reference internal" href="4.2-compatibility.html#compat-remove-repairdatabase"><span class="std std-ref">Remove Support for the repairDatabase Command</span></a>.</td>
</tr>
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">getPrevError</span></code></td>
<td><code class="docutils literal"><span class="pre">db.getPrevError()</span></code></td>
<td>&#160;</td>
</tr>
</tbody>
</table>
<div class="section" id="remove-maxscan-option">
<h4>Remove <code class="docutils literal"><span class="pre">maxScan</span></code> Option<a class="headerlink" href="#remove-maxscan-option" title="Permalink to this headline">¶</a></h4>
<p>MongoDB removes the deprecated option <code class="docutils literal"><span class="pre">maxScan</span></code> for the
<a class="reference internal" href="../reference/command/find.html#dbcmd.find" title="find"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">find</span></code></a> command and the <a class="reference internal" href="../reference/program/mongo.html#bin.mongo" title="bin.mongo"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongo</span></code></a> shell helper
<code class="docutils literal"><span class="pre">cursor.maxScan()</span></code>. Use either the <code class="docutils literal"><span class="pre">maxTimeMS</span></code> option for the
<a class="reference internal" href="../reference/command/find.html#dbcmd.find" title="find"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">find</span></code></a> command or the helper <a class="reference internal" href="../reference/method/cursor.maxTimeMS.html#cursor.maxTimeMS" title="cursor.maxTimeMS()"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">cursor.maxTimeMS()</span></code></a> instead.</p>
</div>
</div>
<div class="section" id="mongodb-drivers">
<span id="drivers"></span><h3>MongoDB Drivers<a class="headerlink" href="#mongodb-drivers" title="Permalink to this headline">¶</a></h3>
<p>The following drivers are feature compatible <a class="footnote-reference" href="#fle" id="id5">[1]</a> with MongoDB 4.2:</p>
<table class="hlist"><tr><td><ul class="simple">
<li><a class="reference external" href="http://mongoc.org/libmongoc/">C 1.15.0</a></li>
<li><a class="reference external" href="https://mongodb.github.io/mongo-csharp-driver/">C# 2.9.0</a></li>
<li><a class="reference external" href="https://godoc.org/go.mongodb.org/mongo-driver/mongo">Go 1.1</a></li>
</ul>
</td><td><ul class="simple">
<li><a class="reference external" href="https://mongodb.github.io/mongo-java-driver/">Java 3.11.0</a></li>
<li><a class="reference external" href="https://mongodb.github.io/node-mongodb-native/">Node 3.3.0</a></li>
<li><a class="reference external" href="https://metacpan.org/author/MONGODB">Perl 2.2.0</a></li>
</ul>
</td><td><ul class="simple">
<li><a class="reference external" href="https://api.mongodb.com/python/current/index.html">Python 3.9.0</a></li>
<li><a class="reference external" href="https://docs.mongodb.com/ruby-driver/current/">Ruby 2.10.0</a></li>
<li><a class="reference external" href="https://mongodb.github.io/mongo-scala-driver/">Scala 2.7.0</a></li>
</ul>
</td></tr></table>
<table class="docutils footnote" frame="void" id="fle" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id5">[1]</a></td><td>For a complete list of official 4.2-compatible drivers with
support for Client-Side Field Level Encryption, see
<a class="reference internal" href="../core/security-client-side-encryption.html#field-level-encryption-drivers"><span class="std std-ref">Driver Compatibility Table</span></a>.</td></tr>
</tbody>
</table>
</div>
<div class="section" id="sharded-clusters">
<h3>Sharded Clusters<a class="headerlink" href="#sharded-clusters" title="Permalink to this headline">¶</a></h3>
<div class="section" id="mutable-shard-key-values">
<h4>Mutable Shard Key Values<a class="headerlink" href="#mutable-shard-key-values" title="Permalink to this headline">¶</a></h4>
<p>Starting in MongoDB 4.2, you can update a document’s shard key value
unless the shard key field is the immutable <code class="docutils literal"><span class="pre">_id</span></code> field. For details
on updating the shard key, see <a class="reference internal" href="../core/sharding-shard-key.html#update-shard-key"><span class="std std-ref">Change a Document’s Shard Key Value</span></a>.</p>
<p>Before MongoDB 4.2, a document’s shard key field value is immutable.</p>
</div>
<div class="section" id="backups">
<h4>Backups<a class="headerlink" href="#backups" title="Permalink to this headline">¶</a></h4>
<p><a class="reference internal" href="../reference/program/mongodump.html#bin.mongodump" title="bin.mongodump"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongodump</span></code></a> and <a class="reference internal" href="../reference/program/mongorestore.html#bin.mongorestore" title="bin.mongorestore"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongorestore</span></code></a>
<strong class="text-danger">cannot</strong> be part of a backup strategy for 4.2+ sharded clusters
that have sharded transactions in progress, as backups created with
<a class="reference internal" href="../reference/program/mongodump.html#bin.mongodump" title="bin.mongodump"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongodump</span></code></a> <em>do not maintain</em> the atomicity guarantees
of transactions across shards.</p>
<p>For 4.2+ sharded clusters with in-progress sharded transactions, use
one of the following coordinated backup and restore processes which
<em>do maintain</em> the atomicity guarantees of transactions across shards:</p>
<ul class="simple">
<li><a class="reference external" href="https://www.mongodb.com/cloud/atlas?tck=docs_server">MongoDB Atlas</a>,</li>
<li><a class="reference external" href="https://www.mongodb.com/cloud/cloud-manager?jmp=docs">MongoDB Cloud Manager</a>, or</li>
<li><a class="reference external" href="https://www.mongodb.com/products/ops-manager?jmp=docs">MongoDB Ops Manager</a>.</li>
</ul>
</div>
<div class="section" id="balancer-state-and-autosplit">
<h4>Balancer State and Autosplit<a class="headerlink" href="#balancer-state-and-autosplit" title="Permalink to this headline">¶</a></h4>
<p>Starting in MongoDB 4.2:</p>
<ul>
<li><p class="first">The <a class="reference internal" href="../reference/command/balancerStart.html#dbcmd.balancerStart" title="balancerStart"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">balancerStart</span></code></a> command and the
<a class="reference internal" href="../reference/program/mongo.html#bin.mongo" title="bin.mongo"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongo</span></code></a> shell helper methods
<a class="reference internal" href="../reference/method/sh.startBalancer.html#sh.startBalancer" title="sh.startBalancer()"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">sh.startBalancer()</span></code></a> and
<a class="reference internal" href="../reference/method/sh.setBalancerState.html#sh.setBalancerState" title="sh.setBalancerState"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">sh.setBalancerState(true)</span></code></a> also
enable auto-splitting for the sharded cluster.</p>
<div class="line-block">
<div class="line">To disable auto-splitting when the balancer is enabled, you can
use <a class="reference internal" href="../reference/method/sh.disableAutoSplit.html#sh.disableAutoSplit" title="sh.disableAutoSplit()"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">sh.disableAutoSplit()</span></code></a>.</div>
</div>
</li>
<li><p class="first">The <a class="reference internal" href="../reference/command/balancerStop.html#dbcmd.balancerStop" title="balancerStop"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">balancerStop</span></code></a> command and the <a class="reference internal" href="../reference/program/mongo.html#bin.mongo" title="bin.mongo"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongo</span></code></a>
shell helper methods <a class="reference internal" href="../reference/method/sh.stopBalancer.html#sh.stopBalancer" title="sh.stopBalancer()"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">sh.stopBalancer()</span></code></a> and
<a class="reference internal" href="../reference/method/sh.setBalancerState.html#sh.setBalancerState" title="sh.setBalancerState"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">sh.setBalancerState(false)</span></code></a> also
disable auto-splitting for the sharded cluster.</p>
<div class="line-block">
<div class="line">To enable auto-splitting when the balancer is disabled, you can
use <a class="reference internal" href="../reference/method/sh.enableAutoSplit.html#sh.enableAutoSplit" title="sh.enableAutoSplit()"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">sh.enableAutoSplit()</span></code></a>.</div>
</div>
</li>
</ul>
<p>The <a class="reference internal" href="../reference/program/mongo.html#bin.mongo" title="bin.mongo"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongo</span></code></a> methods
<a class="reference internal" href="../reference/method/sh.enableBalancing.html#sh.enableBalancing" title="sh.enableBalancing"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">sh.enableBalancing(namespace)</span></code></a> and
<a class="reference internal" href="../reference/method/sh.disableBalancing.html#sh.disableBalancing" title="sh.disableBalancing"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">sh.disableBalancing(namespace)</span></code></a> have no affect on the
auto-splitting.</p>
</div>
<div class="section" id="mongos-connection-pool">
<h4><code class="docutils literal"><span class="pre">mongos</span></code> Connection Pool<a class="headerlink" href="#mongos-connection-pool" title="Permalink to this headline">¶</a></h4>
<p>Starting in MongoDB 4.2, MongoDB adds the parameter
<a class="reference internal" href="../reference/parameters.html#param.ShardingTaskExecutorPoolReplicaSetMatching" title="ShardingTaskExecutorPoolReplicaSetMatching"><code class="xref mongodb mongodb-parameter docutils literal"><span class="pre">ShardingTaskExecutorPoolReplicaSetMatching</span></code></a> that
determines the minimum size (can vary during runtime) of the
<a class="reference internal" href="../reference/program/mongos.html#bin.mongos" title="bin.mongos"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongos</span></code></a> instance’s connection pools to each member of
the sharded cluster.</p>
<p>By default, for each replica set in the sharded cluster (i.e. shard
replica set and config servers), <a class="reference internal" href="../reference/program/mongos.html#bin.mongos" title="bin.mongos"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongos</span></code></a> maintains
connection pools to each replica set secondary that are at least
equal to the size of its connection pool to the primary.</p>
<p>To modify, see <a class="reference internal" href="../reference/parameters.html#param.ShardingTaskExecutorPoolReplicaSetMatching" title="ShardingTaskExecutorPoolReplicaSetMatching"><code class="xref mongodb mongodb-parameter docutils literal"><span class="pre">ShardingTaskExecutorPoolReplicaSetMatching</span></code></a>.</p>
</div>
<div class="section" id="sharded-collections-and-replace-documents">
<h4>Sharded Collections and Replace Documents<a class="headerlink" href="#sharded-collections-and-replace-documents" title="Permalink to this headline">¶</a></h4>
<p>Starting in MongoDB 4.2,</p>
<ul>
<li><p class="first">Replace document operations, such as
<a class="reference internal" href="../reference/method/db.collection.replaceOne.html#db.collection.replaceOne" title="db.collection.replaceOne()"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">db.collection.replaceOne()</span></code></a> or <a class="reference internal" href="../reference/method/db.collection.update.html#update-behavior-replacement-document"><span class="std std-ref">db.collection.update(
query, replacement, … )</span></a>,
attempt to target a single shard, first by using the query filter. If the
operation cannot target a single shard by the query filter, it then
attempts to target by the replacement document.</p>
<p>In earlier versions, the operation attempts to target using the
replacement document.</p>
</li>
<li><p class="first">For a replace document operation that includes <code class="docutils literal"><span class="pre">upsert:</span> <span class="pre">true</span></code>
and is on a sharded collection, the <code class="docutils literal"><span class="pre">filter</span></code> must include an
equality match on the full shard key.</p>
</li>
</ul>
</div>
</div>
<div class="section" id="security-improvements">
<span id="security"></span><h3>Security Improvements<a class="headerlink" href="#security-improvements" title="Permalink to this headline">¶</a></h3>
<div class="section" id="resolved-common-vulnerabilities-and-exposures">
<h4>Resolved Common Vulnerabilities and Exposures<a class="headerlink" href="#resolved-common-vulnerabilities-and-exposures" title="Permalink to this headline">¶</a></h4>
<p>MongoDB 4.2 includes fixes that resolve the following Common
Vulnerabilities and Exposures (CVEs):</p>
<ul class="simple">
<li>CVE-2019-2389 (See <a class="reference external" href="https://jira.mongodb.org/browse/SERVER-40563">SERVER-40563</a>)</li>
<li>CVE-2019-2386 (See <a class="reference external" href="https://jira.mongodb.org/browse/SERVER-38984">SERVER-38984</a>)</li>
</ul>
</div>
<div class="section" id="new-tls-options">
<span id="tls"></span><h4>New <code class="docutils literal"><span class="pre">TLS</span></code> Options<a class="headerlink" href="#new-tls-options" title="Permalink to this headline">¶</a></h4>
<p>MongoDB 4.2 adds <code class="docutils literal"><span class="pre">TLS</span></code> options for the <a class="reference internal" href="../reference/program/mongod.html#tls-mongod-options"><span class="std std-ref">mongod</span></a>, the <a class="reference internal" href="../reference/program/mongos.html#mongos-tls-options"><span class="std std-ref">mongos</span></a>, and the
<a class="reference internal" href="../reference/program/mongo.html#mongo-shell-tls"><span class="std std-ref">mongo shell</span></a> to replace the corresponding
<code class="docutils literal"><span class="pre">SSL</span></code> options (deprecated in 4.2). The new TLS options provide
<strong>identical</strong> functionality as the deprecated <code class="docutils literal"><span class="pre">SSL</span></code> options as MongoDB
has always supported TLS 1.0 and later.</p>
<ul class="simple">
<li>For the command-line TLS options, refer to the <a class="reference internal" href="../reference/program/mongod.html#tls-mongod-options"><span class="std std-ref">mongod</span></a>, <a class="reference internal" href="../reference/program/mongos.html#mongos-tls-options"><span class="std std-ref">mongos</span></a>, and
<a class="reference internal" href="../reference/program/mongo.html#mongo-shell-tls"><span class="std std-ref">mongo shell</span></a> pages.</li>
<li>For the corresponding <code class="docutils literal"><span class="pre">mongod</span></code> and <code class="docutils literal"><span class="pre">mongos</span></code> configuration file
options, refer to the <a class="reference internal" href="../reference/configuration-options.html#net-tls-conf-options"><span class="std std-ref">configuration file</span></a> page.</li>
<li>For the connection string <code class="docutils literal"><span class="pre">tls</span></code> options, refer to the
<a class="reference internal" href="../reference/connection-string.html#uri-options-tls"><span class="std std-ref">connection string</span></a> page.</li>
</ul>
<div class="admonition-tip admonition">
<p class="first admonition-title">Tip</p>
<p>Most of the new <code class="docutils literal"><span class="pre">TLS</span></code> option names are similar to the <code class="docutils literal"><span class="pre">SSL</span></code>
option name; e.g. <a class="reference internal" href="../reference/program/mongod.html#cmdoption-mongod-tlsmode"><code class="xref std std-option docutils literal"><span class="pre">--tlsMode</span></code></a> instead of
<a class="reference internal" href="../reference/program/mongod.html#cmdoption-mongod-sslmode"><code class="xref std std-option docutils literal"><span class="pre">--sslMode</span></code></a>. The exceptions are:</p>
<ul class="last simple">
<li><a class="reference internal" href="../reference/configuration-options.html#net.tls.certificateKeyFile" title="net.tls.certificateKeyFile"><code class="xref mongodb mongodb-setting docutils literal"><span class="pre">net.tls.certificateKeyFile</span></code></a> vs. <a class="reference internal" href="../reference/configuration-options.html#net.ssl.PEMKeyFile" title="net.ssl.PEMKeyFile"><code class="xref mongodb mongodb-setting docutils literal"><span class="pre">net.ssl.PEMKeyFile</span></code></a></li>
<li><a class="reference internal" href="../reference/configuration-options.html#net.tls.certificateKeyFilePassword" title="net.tls.certificateKeyFilePassword"><code class="xref mongodb mongodb-setting docutils literal"><span class="pre">net.tls.certificateKeyFilePassword</span></code></a> vs. <a class="reference internal" href="../reference/configuration-options.html#net.ssl.PEMKeyPassword" title="net.ssl.PEMKeyPassword"><code class="xref mongodb mongodb-setting docutils literal"><span class="pre">net.ssl.PEMKeyPassword</span></code></a></li>
<li><a class="reference internal" href="../reference/program/mongod.html#cmdoption-mongod-tlscertificatekeyfile"><code class="xref std std-option docutils literal"><span class="pre">--tlsCertificateKeyFile</span></code></a> vs.  <a class="reference internal" href="../reference/program/mongod.html#cmdoption-mongod-sslpemkeyfile"><code class="xref std std-option docutils literal"><span class="pre">--sslPEMKeyFile</span></code></a></li>
<li><a class="reference internal" href="../reference/program/mongod.html#cmdoption-mongod-tlscertificatekeyfile"><code class="xref std std-option docutils literal"><span class="pre">--tlsCertificateKeyFilePassword</span></code></a> vs.  <a class="reference internal" href="../reference/program/mongod.html#cmdoption-mongod-sslpemkeypassword"><code class="xref std std-option docutils literal"><span class="pre">--sslPEMKeyPassword</span></code></a></li>
</ul>
</div>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="#tlsclustercafile"><span class="std std-ref">New tlsClusterCAFile Option</span></a></p>
</div>
</div>
<div class="section" id="deprecated-ssl-options">
<h4>Deprecated <code class="docutils literal"><span class="pre">SSL</span></code> Options<a class="headerlink" href="#deprecated-ssl-options" title="Permalink to this headline">¶</a></h4>
<p>MongoDB 4.2 deprecates the <code class="docutils literal"><span class="pre">SSL</span></code> options for the <a class="reference internal" href="../reference/program/mongod.html#ssl-mongod-options"><span class="std std-ref">mongod</span></a>, the <a class="reference internal" href="../reference/program/mongos.html#mongos-ssl-options"><span class="std std-ref">mongos</span></a>, and the
<a class="reference internal" href="../reference/program/mongo.html#mongo-shell-ssl"><span class="std std-ref">mongo shell</span></a> as well as the corresponding
<a class="reference internal" href="../reference/configuration-options.html#net-ssl-conf-options"><span class="std std-ref">net.ssl Options</span></a> configuration file options.</p>
<p>Use the new <a class="reference internal" href="#tls"><span class="std std-ref">TLS</span></a> options instead.</p>
</div>
<div class="section" id="new-tls-parameters">
<h4>New <code class="docutils literal"><span class="pre">tls</span></code> Parameters<a class="headerlink" href="#new-tls-parameters" title="Permalink to this headline">¶</a></h4>
<table border="1" class="colwidths-given docutils">
<colgroup>
<col width="40%" />
<col width="60%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">New Parameter</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><a class="reference internal" href="../reference/parameters.html#param.tlsWithholdClientCertificate" title="tlsWithholdClientCertificate"><code class="xref mongodb mongodb-parameter docutils literal"><span class="pre">tlsWithholdClientCertificate</span></code></a></td>
<td>Available for <a class="reference internal" href="../reference/program/mongod.html#bin.mongod" title="bin.mongod"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongod</span></code></a> and <a class="reference internal" href="../reference/program/mongos.html#bin.mongos" title="bin.mongos"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongos</span></code></a>,
the parameter can be set to <code class="docutils literal"><span class="pre">true</span></code> to stop the instance from
sending its <code class="docutils literal"><span class="pre">TLS</span></code> certificate when initiating intra-cluster
communications with other <a class="reference internal" href="../reference/program/mongod.html#bin.mongod" title="bin.mongod"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongod</span></code></a> or
<a class="reference internal" href="../reference/program/mongos.html#bin.mongos" title="bin.mongos"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongos</span></code></a> instances. For details, see
<a class="reference internal" href="../reference/parameters.html#param.tlsWithholdClientCertificate" title="tlsWithholdClientCertificate"><code class="xref mongodb mongodb-parameter docutils literal"><span class="pre">tlsWithholdClientCertificate</span></code></a>.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="../reference/parameters.html#param.tlsX509ClusterAuthDNOverride" title="tlsX509ClusterAuthDNOverride"><code class="xref mongodb mongodb-parameter docutils literal"><span class="pre">tlsX509ClusterAuthDNOverride</span></code></a></td>
<td><p class="first">Available for <a class="reference internal" href="../reference/program/mongod.html#bin.mongod" title="bin.mongod"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongod</span></code></a> and <a class="reference internal" href="../reference/program/mongos.html#bin.mongos" title="bin.mongos"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongos</span></code></a>,
the parameter can be set to an alternative certificate <code class="docutils literal"><span class="pre">DN</span></code> to
use for <a class="reference internal" href="../tutorial/configure-x509-member-authentication.html"><span class="doc">x.509 membership authentication</span></a>. For details,
see <a class="reference internal" href="../reference/parameters.html#param.tlsX509ClusterAuthDNOverride" title="tlsX509ClusterAuthDNOverride"><code class="xref mongodb mongodb-parameter docutils literal"><span class="pre">tlsX509ClusterAuthDNOverride</span></code></a>.</p>
<p class="last">You can use this parameter for a rolling update of certificates
to new certificates that contain a new <code class="docutils literal"><span class="pre">DN</span></code> value. See
<a class="reference internal" href="../tutorial/rotate-x509-membership-certificates.html"><span class="doc">Rolling Update of x.509 Cluster Certificates that Contain New DN</span></a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="new-tlsclustercafile-option">
<span id="tlsclustercafile"></span><h4>New <code class="docutils literal"><span class="pre">tlsClusterCAFile</span></code> Option<a class="headerlink" href="#new-tlsclustercafile-option" title="Permalink to this headline">¶</a></h4>
<p>MongoDB 4.2 adds the
<a class="reference internal" href="../reference/program/mongod.html#cmdoption-mongod-tlsclustercafile"><code class="xref std std-option docutils literal"><span class="pre">--tlsClusterCAFile</span></code></a> option/<a class="reference internal" href="../reference/configuration-options.html#net.tls.clusterCAFile" title="net.tls.clusterCAFile"><code class="xref mongodb mongodb-setting docutils literal"><span class="pre">net.tls.clusterCAFile</span></code></a> for
<a class="reference internal" href="../reference/program/mongod.html#bin.mongod" title="bin.mongod"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongod</span></code></a> and <a class="reference internal" href="../reference/program/mongos.html#bin.mongos" title="bin.mongos"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongos</span></code></a>, which specifies a
<code class="file docutils literal"><span class="pre">.pem</span></code> file for validating the TLS certificate from a client
establishing a connection. This lets you use separate Certificate Authorities
to verify the client to server and server to client portions of the TLS
handshake.</p>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="#tls"><span class="std std-ref">New TLS Options</span></a></p>
</div>
</div>
<div class="section" id="forward-secrecy">
<h4>Forward Secrecy<a class="headerlink" href="#forward-secrecy" title="Permalink to this headline">¶</a></h4>
<p>Starting in version 4.2 on Linux:</p>
<ul class="simple">
<li>If the platform’s OpenSSL supports automatic curve selection for
Elliptic Curve Diffie-Hellman, MongoDB enables support for
<a class="reference internal" href="../core/security-transport-encryption.html#ecdhe"><span class="std std-ref">Ephemeral Elliptic Curve Diffie-Hellman (ECDHE)</span></a>.</li>
<li>If the platform’s OpenSSL does not support automatic curve selection
for Elliptic Curve Diffie-Hellman, MongoDB attempts to enable ECDHE
support using <code class="docutils literal"><span class="pre">prime256v1</span></code> as the named curve.</li>
<li>If support for ECDHE is enabled, MongoDB attempts to enable support
for <a class="reference internal" href="../core/security-transport-encryption.html#dhe"><span class="std std-ref">Ephemeral Diffie-Hellman (DHE)</span></a> if <a class="reference internal" href="../core/security-transport-encryption.html#dhe"><span class="std std-ref">Ephemeral Diffie-Hellman (DHE)</span></a> is not explicitly enabled.</li>
</ul>
<p>In earlier versions of MongoDB (3.6.14+ and 4.0.3+), MongoDB enables
support for Ephemeral Elliptic Curve Diffie-Hellman (ECDHE) if, during
compile time, the Linux platform’s OpenSSL supports automatic curve
selection of ECDH parameters.</p>
<p>On Windows and macOS, MongoDB’s support for ECDHE and DH remain
unchanged from earlier versions; that is, support is implicit through
the use of the platform’s respective native TLS/SSL OS libraries.</p>
<p>For more information, see <a class="reference internal" href="../core/security-transport-encryption.html#tls-forward-secrecy"><span class="std std-ref">Forward Secrecy</span></a>.</p>
</div>
<div class="section" id="passwordprompt">
<h4><code class="docutils literal"><span class="pre">passwordPrompt()</span></code><a class="headerlink" href="#passwordprompt" title="Permalink to this headline">¶</a></h4>
<p>Starting in version 4.2 of the <a class="reference internal" href="../reference/program/mongo.html#bin.mongo" title="bin.mongo"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongo</span></code></a> shell, you can
use the <a class="reference internal" href="../reference/method/passwordPrompt.html#passwordPrompt" title="passwordPrompt()"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">passwordPrompt()</span></code></a> method in conjunction with
various user authentication/management methods/commands to prompt
for the password instead of specifying the password directly in the
method/command call. However, you can still specify the password
directly as you would with earlier versions of the
<a class="reference internal" href="../reference/program/mongo.html#bin.mongo" title="bin.mongo"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongo</span></code></a> shell.</p>
<p>For example:</p>
<div class="button-code-block">
<div class="button-row">
<a class="code-button--copy code-button" role="button">
copy</a>
</div>
<div class="copyable-code-block highlight-javascript"><div class="highlight"><pre><span></span><span class="nx">db</span><span class="p">.</span><span class="nx">createUser</span><span class="p">(</span> <span class="p">{</span>
   <span class="nx">user</span><span class="o">:</span><span class="s2">&quot;user123&quot;</span><span class="p">,</span>
   <span class="nx">pwd</span><span class="o">:</span> <span class="nx">passwordPrompt</span><span class="p">(),</span>   <span class="c1">// Instead of specifying the password in cleartext</span>
   <span class="nx">roles</span><span class="o">:</span><span class="p">[</span> <span class="s2">&quot;readWrite&quot;</span> <span class="p">]</span>
<span class="p">}</span> <span class="p">)</span>
</pre></div>
</div>
</div>
</div>
<div class="section" id="keyfile-format-change-to-yaml">
<h4>Keyfile Format Change to YAML<a class="headerlink" href="#keyfile-format-change-to-yaml" title="Permalink to this headline">¶</a></h4>
<p>Starting in MongoDB 4.2, <a class="reference internal" href="../core/security-internal-authentication.html#internal-auth-keyfile"><span class="std std-ref">keyfiles for internal membership
authentication</span></a> use YAML format to allow for
multiple keys in a keyfile. The YAML format accepts content of:</p>
<ul class="simple">
<li>a single key string (same as in earlier versions),</li>
<li>multiple key strings (each string must be enclosed in quotes), or</li>
<li>sequence of key strings.</li>
</ul>
<p>The YAML format is compatible with the existing single-key
keyfiles that use the text file format.</p>
<p>The new format allows for rolling upgrade of the keys without downtime.
See <a class="reference internal" href="../tutorial/rotate-key-replica-set.html"><span class="doc">Rotate Keys for Replica Sets</span></a> and
<a class="reference internal" href="../tutorial/rotate-key-sharded-cluster.html"><span class="doc">Rotate Keys for Sharded Clusters</span></a>.</p>
</div>
<div class="section" id="libldap-and-libldap-r">
<h4><code class="docutils literal"><span class="pre">libldap</span></code> and <code class="docutils literal"><span class="pre">libldap_r</span></code><a class="headerlink" href="#libldap-and-libldap-r" title="Permalink to this headline">¶</a></h4>
<p>For MongoDB 4.2 (and 4.0.9) Enterprise binaries linked against
<code class="docutils literal"><span class="pre">libldap</span></code> (such as when running on RHEL), access to the
<code class="docutils literal"><span class="pre">libldap</span></code> is synchronized, incurring some performance/latency
costs.</p>
<p>For MongoDB 4.2 (and 4.0.9) Enterprise binaries linked against
<code class="docutils literal"><span class="pre">libldap_r</span></code>, there is no change in behavior from earlier MongoDB
versions.</p>
</div>
<div class="section" id="encrypted-storage-engine">
<h4>Encrypted Storage Engine<a class="headerlink" href="#encrypted-storage-engine" title="Permalink to this headline">¶</a></h4>
<p>For <a class="reference internal" href="../core/security-encryption-at-rest.html#encrypted-storage-engine"><span class="std std-ref">encrypted storage engine</span></a>
configured with <code class="docutils literal"><span class="pre">AES256-GCM</span></code> cipher:</p>
<ul>
<li><dl class="first docutils">
<dt>Restoring from Hot Backup</dt>
<dd><p class="first last">Starting in 4.2, if you restore from files taken via “hot”
backup (i.e. the <a class="reference internal" href="../reference/program/mongod.html#bin.mongod" title="bin.mongod"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongod</span></code></a> is running), MongoDB
can detect “dirty” keys on startup and automatically rollover
the database key to avoid IV (Initialization Vector) reuse.</p>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>Restoring from Cold Backup</dt>
<dd><p class="first">However, if you restore from files taken via “cold” backup
(i.e. the <a class="reference internal" href="../reference/program/mongod.html#bin.mongod" title="bin.mongod"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongod</span></code></a> is not running), MongoDB
cannot detect “dirty” keys on startup, and reuse of IV voids
confidentiality and integrity guarantees.</p>
<p class="last">Starting in 4.2, to avoid the reuse of the keys after
restoring from a cold filesystem snapshot, MongoDB adds a new
command-line option <a class="reference internal" href="../reference/program/mongod.html#cmdoption-mongod-esedatabasekeyrollover"><code class="xref std std-option docutils literal"><span class="pre">--eseDatabaseKeyRollover</span></code></a>. When started with the
<a class="reference internal" href="../reference/program/mongod.html#cmdoption-mongod-esedatabasekeyrollover"><code class="xref std std-option docutils literal"><span class="pre">--eseDatabaseKeyRollover</span></code></a> option, the <a class="reference internal" href="../reference/program/mongod.html#bin.mongod" title="bin.mongod"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongod</span></code></a>
instance rolls over the database keys configured with
<code class="docutils literal"><span class="pre">AES256-GCM</span></code> cipher and exits.</p>
</dd>
</dl>
</li>
</ul>
<p>For more information, see <a class="reference internal" href="../core/security-encryption-at-rest.html#encrypted-storage-engine"><span class="std std-ref">encrypted storage engine</span></a> and <a class="reference internal" href="../reference/program/mongod.html#cmdoption-mongod-esedatabasekeyrollover"><code class="xref std std-option docutils literal"><span class="pre">--eseDatabaseKeyRollover</span></code></a>.</p>
</div>
<div class="section" id="client-side-field-level-encryption">
<h4>Client-Side Field Level Encryption<a class="headerlink" href="#client-side-field-level-encryption" title="Permalink to this headline">¶</a></h4>
<p>The official <a class="reference internal" href="../core/security-client-side-encryption.html#field-level-encryption-drivers"><span class="std std-ref">MongoDB 4.2-compatible drivers</span></a> provide a client-side field level
encryption framework. Applications can encrypt fields in documents
<em>prior</em> to transmitting data over the wire to the server. Only
applications with access to the correct encryption keys can decrypt and
read the protected data. Deleting an encryption key renders all data
encrypted with that key as permanently unreadable.</p>
<p>For a complete list of official 4.2-compatible drivers with support
for client-side field level encryption, see
<a class="reference internal" href="../core/security-client-side-encryption.html#field-level-encryption-drivers"><span class="std std-ref">Driver Compatibility Table</span></a>.</p>
<p>For an end-to-end procedure for configuring field level encryption using
select MongoDB 4.2-compatible drivers, see the
<a class="reference external" href="https://docs.mongodb.com/ecosystem/use-cases/client-side-field-level-encryption-guide/">Client Side Field Level Encryption Guide</a>.</p>
<dl class="docutils">
<dt>Explicit (manual) encryption of fields</dt>
<dd><p class="first">Official MongoDB 4.2-compatible drivers and the MongoDB 4.2
<a class="reference internal" href="../reference/program/mongo.html#bin.mongo" title="bin.mongo"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongo</span></code></a> shell support explicitly encrypting or decrypting
fields with a specific data encryption key and encryption algorithm.</p>
<p>Applications must modify any code associated with constructing read
and write operations to include encryption/decryption logic via the
driver encryption library. Applications are responsible for selecting
the appropriate data encryption key for encryption/decryption on a
per-operation basis.</p>
<p class="last">For more information, see
<a class="reference internal" href="../core/security-explicit-client-side-encryption.html"><span class="doc">Explicit (Manual) Client-Side Field Level Encryption</span></a>.</p>
</dd>
<dt>Automatic encryption of fields</dt>
<dd><div class="admonition-enterprise-feature first admonition">
<p class="first admonition-title">Enterprise Feature</p>
<p class="last">The automatic feature of field level encryption is only available
in MongoDB 4.2 Enterprise and MongoDB Atlas 4.2 clusters.</p>
</div>
<p>Official MongoDB 4.2-compatible drivers and the MongoDB 4.2
<a class="reference internal" href="../reference/program/mongo.html#bin.mongo" title="bin.mongo"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongo</span></code></a> shell support automatically encrypting fields in
read and write operations.</p>
<p>Applications must create a database connection object (e.g.
<code class="docutils literal"><span class="pre">MongoClient</span></code>) with the automatic encryption configuration settings.
The configuration settings must include automatic encryption
encryption rules using a strict subset of the
<a class="reference external" href="https://tools.ietf.org/html/draft-zyp-json-schema-04">JSON Schema Draft 4 standard syntax</a> and
encryption-specific schema keywords. Applications do not have to
modify code associated with constructing the read/write operation.
See <a class="reference internal" href="../reference/security-client-side-automatic-json-schema.html#field-level-encryption-json-schema"><span class="std std-ref">Automatic Encryption Rules</span></a> for complete
documentation on automatic encryption rules.</p>
<p class="last">For more information, see
<a class="reference internal" href="../core/security-automatic-client-side-encryption.html"><span class="doc">Automatic Client-Side Field Level Encryption</span></a>.</p>
</dd>
</dl>
<p>For complete documentation on client-side field level encryption,
see <a class="reference internal" href="../core/security-client-side-encryption.html"><span class="doc">Client-Side Field Level Encryption</span></a>.</p>
</div>
<div class="section" id="general-security-enhancements">
<h4>General Security Enhancements<a class="headerlink" href="#general-security-enhancements" title="Permalink to this headline">¶</a></h4>
<ul>
<li><p class="first">Add <a class="reference internal" href="../reference/privilege-actions.html#serverStatus" title="serverStatus"><code class="xref mongodb mongodb-authaction docutils literal"><span class="pre">serverStatus</span></code></a> to the <a class="reference internal" href="../reference/built-in-roles.html#backup" title="backup"><code class="xref mongodb mongodb-authrole docutils literal"><span class="pre">backup</span></code></a> built-in
role.</p>
</li>
<li><p class="first">To connect a client over TLS/SSL connection, MongoDB 4.2 supports
matching by IP addresses as well as DNS for Subject Alternative Name
(SAN) matching.</p>
<p>For example, a <a class="reference internal" href="../reference/program/mongod.html#bin.mongod" title="bin.mongod"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongod</span></code></a> instance’s x.509 certificate
has the following SAN:</p>
<div class="button-code-block">
<div class="button-row">
</div>
<div class="highlight-none"><div class="highlight"><pre><span></span>X509v3 Subject Alternative Name:
    DNS:hostname.example.com, DNS:localhost, IP Address:127.0.0.1
</pre></div>
</div>
</div>
<p>Then, to connect a <a class="reference internal" href="../reference/program/mongo.html#bin.mongo" title="bin.mongo"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongo</span></code></a> shell to the instance, you
can specify the host of <code class="docutils literal"><span class="pre">127.0.0.1</span></code> or the DNS names:</p>
<ul>
<li><div class="first button-code-block">
<div class="button-row">
</div>
<div class="highlight-none"><div class="highlight"><pre><span></span>mongo &quot;mongodb:\\127.0.0.1:27017\test&quot; --tls --tlsCAFile /etc/ssl/ca.pem ...
</pre></div>
</div>
</div>
</li>
<li><div class="first button-code-block">
<div class="button-row">
</div>
<div class="highlight-none"><div class="highlight"><pre><span></span>mongo &quot;mongodb:\\hostname.example.com:27017\test&quot; --tls --tlsCAFile /etc/ssl/ca.pem ...
</pre></div>
</div>
</div>
</li>
<li><div class="first button-code-block">
<div class="button-row">
</div>
<div class="highlight-none"><div class="highlight"><pre><span></span>mongo &quot;mongodb:\\localhost:27017\test&quot; --tls --tlsCAFile /etc/ssl/ca.pem ...
</pre></div>
</div>
</div>
</li>
</ul>
<p>In previous versions, MongoDB only supported DNS entries for SAN
matching.</p>
<ul>
<li><div class="first button-code-block">
<div class="button-row">
</div>
<div class="highlight-none"><div class="highlight"><pre><span></span>mongo &quot;mongodb:\\hostname.example.com:27017\test&quot; --tls --tlsCAFile /etc/ssl/ca.pem ...
</pre></div>
</div>
</div>
</li>
<li><div class="first button-code-block">
<div class="button-row">
</div>
<div class="highlight-none"><div class="highlight"><pre><span></span>mongo &quot;mongodb:\\localhost:27017\test&quot; --tls  --tlsCAFile /etc/ssl/ca.pem ...
</pre></div>
</div>
</div>
</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="ldap-query-template-provided-user-token">
<h4>LDAP Query Template <code class="docutils literal"><span class="pre">{PROVIDED_USER}</span></code> Token<a class="headerlink" href="#ldap-query-template-provided-user-token" title="Permalink to this headline">¶</a></h4>
<p>Starting in version 4.2, MongoDB Enterprise adds a new token
<code class="docutils literal"><span class="pre">{PROVIDED_USER}</span></code> that can be used in
<a class="reference internal" href="../reference/configuration-options.html#security.ldap.authz.queryTemplate" title="security.ldap.authz.queryTemplate"><code class="xref mongodb mongodb-setting docutils literal"><span class="pre">security.ldap.authz.queryTemplate</span></code></a>. When used in the
template, MongoDB substitutes the supplied username, i.e. before either
authentication or <a class="reference internal" href="../reference/configuration-options.html#security.ldap.userToDNMapping" title="security.ldap.userToDNMapping"><code class="xref mongodb mongodb-setting docutils literal"><span class="pre">LDAP</span> <span class="pre">transformation</span></code></a>.</p>
</div>
</div>
<div class="section" id="aggregation-improvements">
<span id="agg"></span><h3>Aggregation Improvements<a class="headerlink" href="#aggregation-improvements" title="Permalink to this headline">¶</a></h3>
<div class="section" id="on-demand-materialized-view-merge-stage">
<span id="agg-merge"></span><h4>On-Demand Materialized View (<code class="docutils literal"><span class="pre">$merge</span></code> Stage)<a class="headerlink" href="#on-demand-materialized-view-merge-stage" title="Permalink to this headline">¶</a></h4>
<p>MongoDB 4.2 adds the <a class="reference internal" href="../reference/operator/aggregation/merge.html#pipe._S_merge" title="$merge"><code class="xref mongodb mongodb-pipeline docutils literal"><span class="pre">$merge</span></code></a> aggregation stage.</p>
<p>With the new stage you can:</p>
<ul class="simple">
<li>Can output to a collection in the same or different database.</li>
<li>Can incorporate results (merge documents, replace documents, keep
existing documents, fail the operation, process documents with an
custom update pipeline) into an existing collection.</li>
<li>Can output to an existing sharded collection.</li>
</ul>
<p>The new stage allows users to create <a class="reference internal" href="../core/materialized-views.html"><span class="doc">on-demand materialized views</span></a>, where the content of the output collection
can be incrementally updated each time the pipeline is run.</p>
</div>
<div class="section" id="aggregation-trigonometry-expressions">
<span id="trigonometry-expressions"></span><h4>Aggregation Trigonometry Expressions<a class="headerlink" href="#aggregation-trigonometry-expressions" title="Permalink to this headline">¶</a></h4>
<p>MongoDB 4.2 adds new
trigonometry expressions for use in aggregation pipelines.</p>
<p>Trigonometry expressions perform trigonometric operations on numbers.
Values that represent angles are always input or output in  radians. Use
<a class="reference internal" href="../reference/operator/aggregation/degreesToRadians.html#exp._S_degreesToRadians" title="$degreesToRadians"><code class="xref mongodb mongodb-expression docutils literal"><span class="pre">$degreesToRadians</span></code></a> and <a class="reference internal" href="../reference/operator/aggregation/radiansToDegrees.html#exp._S_radiansToDegrees" title="$radiansToDegrees"><code class="xref mongodb mongodb-expression docutils literal"><span class="pre">$radiansToDegrees</span></code></a> to
convert between degree and radian measurements.</p>
<table border="1" class="colwidths-given docutils">
<colgroup>
<col width="20%" />
<col width="80%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Name</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><a class="reference internal" href="../reference/operator/aggregation/sin.html#exp._S_sin" title="$sin"><code class="xref mongodb mongodb-expression docutils literal"><span class="pre">$sin</span></code></a></td>
<td>Returns the sine of a value that is measured in radians.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="../reference/operator/aggregation/cos.html#exp._S_cos" title="$cos"><code class="xref mongodb mongodb-expression docutils literal"><span class="pre">$cos</span></code></a></td>
<td>Returns the cosine of a value that is measured in radians.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="../reference/operator/aggregation/tan.html#exp._S_tan" title="$tan"><code class="xref mongodb mongodb-expression docutils literal"><span class="pre">$tan</span></code></a></td>
<td>Returns the tangent of a value that is measured in radians.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="../reference/operator/aggregation/asin.html#exp._S_asin" title="$asin"><code class="xref mongodb mongodb-expression docutils literal"><span class="pre">$asin</span></code></a></td>
<td>Returns the inverse sin (arc sine) of a value in radians.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="../reference/operator/aggregation/acos.html#exp._S_acos" title="$acos"><code class="xref mongodb mongodb-expression docutils literal"><span class="pre">$acos</span></code></a></td>
<td>Returns the inverse cosine (arc cosine) of a value in radians.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="../reference/operator/aggregation/atan.html#exp._S_atan" title="$atan"><code class="xref mongodb mongodb-expression docutils literal"><span class="pre">$atan</span></code></a></td>
<td>Returns the inverse tangent (arc tangent) of a value in
radians.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="../reference/operator/aggregation/atan2.html#exp._S_atan2" title="$atan2"><code class="xref mongodb mongodb-expression docutils literal"><span class="pre">$atan2</span></code></a></td>
<td>Returns the inverse tangent (arc tangent) of <code class="docutils literal"><span class="pre">y</span> <span class="pre">/</span> <span class="pre">x</span></code> in
radians, where <code class="docutils literal"><span class="pre">y</span></code> and <code class="docutils literal"><span class="pre">x</span></code> are the first and second
values passed to the expression respectively.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="../reference/operator/aggregation/asinh.html#exp._S_asinh" title="$asinh"><code class="xref mongodb mongodb-expression docutils literal"><span class="pre">$asinh</span></code></a></td>
<td>Returns the inverse hyperbolic sine (hyperbolic arc sine) of a
value in radians.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="../reference/operator/aggregation/acosh.html#exp._S_acosh" title="$acosh"><code class="xref mongodb mongodb-expression docutils literal"><span class="pre">$acosh</span></code></a></td>
<td>Returns the inverse hyperbolic cosine (hyperbolic arc cosine)
of a value in radians.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="../reference/operator/aggregation/atanh.html#exp._S_atanh" title="$atanh"><code class="xref mongodb mongodb-expression docutils literal"><span class="pre">$atanh</span></code></a></td>
<td>Returns the inverse hyperbolic tangent (hyperbolic arc
tangent) of a value in radians.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="../reference/operator/aggregation/degreesToRadians.html#exp._S_degreesToRadians" title="$degreesToRadians"><code class="xref mongodb mongodb-expression docutils literal"><span class="pre">$degreesToRadians</span></code></a></td>
<td>Converts a value from degrees to radians.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="../reference/operator/aggregation/radiansToDegrees.html#exp._S_radiansToDegrees" title="$radiansToDegrees"><code class="xref mongodb mongodb-expression docutils literal"><span class="pre">$radiansToDegrees</span></code></a></td>
<td>Converts a value from radians to degrees.</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="aggregation-arithmetic-expressions">
<span id="round-trig-expressions"></span><h4>Aggregation Arithmetic Expressions<a class="headerlink" href="#aggregation-arithmetic-expressions" title="Permalink to this headline">¶</a></h4>
<p>MongoDB 4.2 adds the <a class="reference internal" href="../reference/operator/aggregation/round.html#exp._S_round" title="$round"><code class="xref mongodb mongodb-expression docutils literal"><span class="pre">$round</span></code></a> aggregation expression.
Use <a class="reference internal" href="../reference/operator/aggregation/round.html#exp._S_round" title="$round"><code class="xref mongodb mongodb-expression docutils literal"><span class="pre">$round</span></code></a> to round numerical values to a specific
digit or decimal place.</p>
<p>MongoDB 4.2 adds expanded functionality and new syntax to
<a class="reference internal" href="../reference/operator/aggregation/trunc.html#exp._S_trunc" title="$trunc"><code class="xref mongodb mongodb-expression docutils literal"><span class="pre">$trunc</span></code></a>. Use <a class="reference internal" href="../reference/operator/aggregation/trunc.html#exp._S_trunc" title="$trunc"><code class="xref mongodb mongodb-expression docutils literal"><span class="pre">$trunc</span></code></a> with the new syntax
to truncate numerical values to a specific digit or decimal place.</p>
</div>
<div class="section" id="aggregation-regular-expressions-regex-operators">
<span id="agg-regex-operators"></span><h4>Aggregation Regular Expressions (regex) Operators<a class="headerlink" href="#aggregation-regular-expressions-regex-operators" title="Permalink to this headline">¶</a></h4>
<p>MongoDB 4.2 adds the following regular expression (regex) pattern
matching operators for use in the aggregation pipeline:</p>
<table border="1" class="colwidths-given docutils">
<colgroup>
<col width="20%" />
<col width="80%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Operator</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><a class="reference internal" href="../reference/operator/aggregation/regexFind.html#exp._S_regexFind" title="$regexFind"><code class="xref mongodb mongodb-expression docutils literal"><span class="pre">$regexFind</span></code></a></td>
<td>Applies a regular expression (regex) to a string and returns
information on the <em>first</em> matched substring.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="../reference/operator/aggregation/regexFindAll.html#exp._S_regexFindAll" title="$regexFindAll"><code class="xref mongodb mongodb-expression docutils literal"><span class="pre">$regexFindAll</span></code></a></td>
<td>Applies a regular expression (regex) to a string and returns
information on all matched substrings.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="../reference/operator/aggregation/regexMatch.html#exp._S_regexMatch" title="$regexMatch"><code class="xref mongodb mongodb-expression docutils literal"><span class="pre">$regexMatch</span></code></a></td>
<td>Applies a regular expression (regex) to a string and returns
<code class="docutils literal"><span class="pre">true</span></code> if a match is found and <code class="docutils literal"><span class="pre">false</span></code> if a match is not
found.</td>
</tr>
</tbody>
</table>
<p>Prior to MongoDB 4.2, aggregation pipeline can only use the query
operator <a class="reference internal" href="../reference/operator/query/regex.html#op._S_regex" title="$regex"><code class="xref mongodb mongodb-query docutils literal"><span class="pre">$regex</span></code></a> in the <a class="reference internal" href="../reference/operator/aggregation/match.html#pipe._S_match" title="$match"><code class="xref mongodb mongodb-pipeline docutils literal"><span class="pre">$match</span></code></a> stage.</p>
</div>
<div class="section" id="new-stages">
<h4>New Stages<a class="headerlink" href="#new-stages" title="Permalink to this headline">¶</a></h4>
<p>MongoDB 4.2 adds the following new aggregation pipeline stages:</p>
<table border="1" class="colwidths-given docutils">
<colgroup>
<col width="15%" />
<col width="85%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">New Stage</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><a class="reference internal" href="../reference/operator/aggregation/merge.html#pipe._S_merge" title="$merge"><code class="xref mongodb mongodb-pipeline docutils literal"><span class="pre">$merge</span></code></a></td>
<td>Writes the aggregation results to a collection. The
<a class="reference internal" href="../reference/operator/aggregation/merge.html#pipe._S_merge" title="$merge"><code class="xref mongodb mongodb-pipeline docutils literal"><span class="pre">$merge</span></code></a> stage can incorporate results (merge
documents, replace documents, keep existing documents, fail the
operation, process documents with an custom update pipeline)
into an existing collection.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="../reference/operator/aggregation/planCacheStats.html#pipe._S_planCacheStats" title="$planCacheStats"><code class="xref mongodb mongodb-pipeline docutils literal"><span class="pre">$planCacheStats</span></code></a></td>
<td><p class="first">Provides <a class="reference internal" href="../core/query-plans.html"><span class="doc">plan cache</span></a> information for a collection.</p>
<p>The <a class="reference internal" href="../reference/operator/aggregation/planCacheStats.html#pipe._S_planCacheStats" title="$planCacheStats"><code class="xref mongodb mongodb-pipeline docutils literal"><span class="pre">$planCacheStats</span></code></a> aggregation stage is preferred over
the following methods and commands, which have been deprecated in 4.2:</p>
<ul class="simple">
<li><a class="reference internal" href="../reference/method/PlanCache.getPlansByQuery.html#PlanCache.getPlansByQuery" title="PlanCache.getPlansByQuery()"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">PlanCache.getPlansByQuery()</span></code></a>
method/<a class="reference internal" href="../reference/command/planCacheListPlans.html#dbcmd.planCacheListPlans" title="planCacheListPlans"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">planCacheListPlans</span></code></a> command, and</li>
<li><a class="reference internal" href="../reference/method/PlanCache.listQueryShapes.html#PlanCache.listQueryShapes" title="PlanCache.listQueryShapes()"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">PlanCache.listQueryShapes()</span></code></a>
method/<a class="reference internal" href="../reference/command/planCacheListQueryShapes.html#dbcmd.planCacheListQueryShapes" title="planCacheListQueryShapes"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">planCacheListQueryShapes</span></code></a> command.</li>
</ul>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="4.2-compatibility.html#deprecated-plan-cache"><span class="std std-ref">Deprecated Plan Cache Commands/Methods</span></a></p>
</div>
</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="../reference/operator/aggregation/replaceWith.html#pipe._S_replaceWith" title="$replaceWith"><code class="xref mongodb mongodb-pipeline docutils literal"><span class="pre">$replaceWith</span></code></a></td>
<td>Replaces the input document with the specified document. The
operation replaces all existing fields in the input document,
including the <code class="docutils literal"><span class="pre">_id</span></code> field. The new <a class="reference internal" href="../reference/operator/aggregation/replaceWith.html#pipe._S_replaceWith" title="$replaceWith"><code class="xref mongodb mongodb-pipeline docutils literal"><span class="pre">$replaceWith</span></code></a>
stage is an alias to the <a class="reference internal" href="../reference/operator/aggregation/replaceRoot.html#pipe._S_replaceRoot" title="$replaceRoot"><code class="xref mongodb mongodb-pipeline docutils literal"><span class="pre">$replaceRoot</span></code></a> stage.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="../reference/operator/aggregation/set.html#pipe._S_set" title="$set"><code class="xref mongodb mongodb-pipeline docutils literal"><span class="pre">$set</span></code></a></td>
<td>Adds new fields to documents. The stage outputs documents that
contains all existing fields from the input documents as well as
the newly added fields. The new <a class="reference internal" href="../reference/operator/aggregation/set.html#pipe._S_set" title="$set"><code class="xref mongodb mongodb-pipeline docutils literal"><span class="pre">$set</span></code></a> stage is an
alias to the <a class="reference internal" href="../reference/operator/aggregation/addFields.html#pipe._S_addFields" title="$addFields"><code class="xref mongodb mongodb-pipeline docutils literal"><span class="pre">$addFields</span></code></a> stage.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="../reference/operator/aggregation/unset.html#pipe._S_unset" title="$unset"><code class="xref mongodb mongodb-pipeline docutils literal"><span class="pre">$unset</span></code></a></td>
<td>Excludes fields from documents. The new <a class="reference internal" href="../reference/operator/aggregation/unset.html#pipe._S_unset" title="$unset"><code class="xref mongodb mongodb-pipeline docutils literal"><span class="pre">$unset</span></code></a> stage
is an alias to the <a class="reference internal" href="../reference/operator/aggregation/project.html#pipe._S_project" title="$project"><code class="xref mongodb mongodb-pipeline docutils literal"><span class="pre">$project</span></code></a> stage that excludes
fields.</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="new-variables">
<h4>New Variables<a class="headerlink" href="#new-variables" title="Permalink to this headline">¶</a></h4>
<p>MongoDB 4.2 adds the following new aggregation pipeline variables:</p>
<table border="1" class="colwidths-given docutils">
<colgroup>
<col width="30%" />
<col width="70%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Variable</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><a class="reference internal" href="../reference/aggregation-variables.html#variable.NOW" title="NOW"><code class="xref mongodb mongodb-variable docutils literal"><span class="pre">NOW</span></code></a></td>
<td>Returns the current datetime value.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="../reference/aggregation-variables.html#variable.CLUSTER_TIME" title="CLUSTER_TIME"><code class="xref mongodb mongodb-variable docutils literal"><span class="pre">CLUSTER_TIME</span></code></a></td>
<td><p class="first">Returns the current  timestamp value.</p>
<p class="last"><em>Only available on replica sets and sharded clusters.</em></p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="availability">
<h4>Availability<a class="headerlink" href="#availability" title="Permalink to this headline">¶</a></h4>
<p>Starting in MongoDB 4.2, you can use the aggregation pipeline for
updates in:</p>
<table border="1" class="docutils">
<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Command</th>
<th class="head"><code class="docutils literal"><span class="pre">mongo</span></code> Shell Methods</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><a class="reference internal" href="../reference/command/findAndModify.html#dbcmd.findAndModify" title="findAndModify"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">findAndModify</span></code></a></td>
<td><div class="first last line-block">
<div class="line"><a class="reference internal" href="../reference/method/db.collection.findOneAndUpdate.html#findoneandupdate-agg-pipeline"><span class="std std-ref">db.collection.findOneAndUpdate()</span></a></div>
<div class="line"><a class="reference internal" href="../reference/method/db.collection.findAndModify.html#findandmodify-agg-pipeline"><span class="std std-ref">db.collection.findAndModify()</span></a></div>
</div>
</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="../reference/command/update.html#dbcmd.update" title="update"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">update</span></code></a></td>
<td><div class="first line-block">
<div class="line"><a class="reference internal" href="../reference/method/db.collection.updateOne.html#updateone-example-agg"><span class="std std-ref">db.collection.updateOne()</span></a></div>
<div class="line"><a class="reference internal" href="../reference/method/db.collection.updateMany.html#updatemany-example-agg"><span class="std std-ref">db.collection.updateMany()</span></a></div>
<div class="line"><a class="reference internal" href="../reference/method/db.collection.update.html#update-example-agg"><span class="std std-ref">db.collection.update()</span></a></div>
</div>
<div class="last line-block">
<div class="line"><a class="reference internal" href="../reference/method/Bulk.find.update.html#example-bulk-find-update-agg"><span class="std std-ref">Bulk.find.update()</span></a></div>
<div class="line"><a class="reference internal" href="../reference/method/Bulk.find.updateOne.html#example-bulk-find-update-one-agg"><span class="std std-ref">Bulk.find.updateOne()</span></a></div>
<div class="line"><a class="reference internal" href="../reference/method/Bulk.find.upsert.html#bulk-find-upsert-update-agg-example"><span class="std std-ref">Bulk.find.upsert()</span></a></div>
</div>
</td>
</tr>
</tbody>
</table>
<p>For the updates, the pipeline can consist of the following stages:</p>
<ul class="simple">
<li><a class="reference internal" href="../reference/operator/aggregation/addFields.html#pipe._S_addFields" title="$addFields"><code class="xref mongodb mongodb-pipeline docutils literal"><span class="pre">$addFields</span></code></a> and its alias <a class="reference internal" href="../reference/operator/aggregation/set.html#pipe._S_set" title="$set"><code class="xref mongodb mongodb-pipeline docutils literal"><span class="pre">$set</span></code></a></li>
<li><a class="reference internal" href="../reference/operator/aggregation/project.html#pipe._S_project" title="$project"><code class="xref mongodb mongodb-pipeline docutils literal"><span class="pre">$project</span></code></a> and its alias <a class="reference internal" href="../reference/operator/aggregation/unset.html#pipe._S_unset" title="$unset"><code class="xref mongodb mongodb-pipeline docutils literal"><span class="pre">$unset</span></code></a></li>
<li><a class="reference internal" href="../reference/operator/aggregation/replaceRoot.html#pipe._S_replaceRoot" title="$replaceRoot"><code class="xref mongodb mongodb-pipeline docutils literal"><span class="pre">$replaceRoot</span></code></a> and its alias <a class="reference internal" href="../reference/operator/aggregation/replaceWith.html#pipe._S_replaceWith" title="$replaceWith"><code class="xref mongodb mongodb-pipeline docutils literal"><span class="pre">$replaceWith</span></code></a>.</li>
</ul>
<p>Using the aggregation pipeline allows for a more expressive update
statement, such as expressing conditional updates based on current
field values or updating one field using the value of another field(s).</p>
<p>See the individual reference pages for details and examples.</p>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<ul class="last simple">
<li><a class="reference internal" href="../tutorial/update-documents-with-aggregation-pipeline.html"><span class="doc">Updates with Aggregation Pipeline</span></a></li>
<li><a class="reference internal" href="4.2-compatibility.html#compat-agg"><span class="std std-ref">Aggregation</span></a></li>
</ul>
</div>
</div>
</div>
<div class="section" id="change-stream">
<span id="id6"></span><h3>Change Stream<a class="headerlink" href="#change-stream" title="Permalink to this headline">¶</a></h3>
<div class="section" id="startafter-option-for-change-streams">
<h4><code class="docutils literal"><span class="pre">startAfter</span></code> Option for Change Streams<a class="headerlink" href="#startafter-option-for-change-streams" title="Permalink to this headline">¶</a></h4>
<p>MongoDB 4.2 adds <code class="docutils literal"><span class="pre">startAfter</span></code> as an option for <a class="reference internal" href="../changeStreams.html#changestreams"><span class="std std-ref">Change Streams</span></a>,
which starts a new change stream after the event indicated by a resume
token. With this option, you can start a change stream from an
<a class="reference internal" href="../reference/change-events.html#change-event-invalidate"><span class="std std-ref">invalidate event</span></a>, thereby guaranteeing
no missed notifications after the previous stream was invalidated.</p>
</div>
<div class="section" id="change-streams-resume-tokens">
<h4>Change Streams Resume Tokens<a class="headerlink" href="#change-streams-resume-tokens" title="Permalink to this headline">¶</a></h4>
<p>MongoDB 4.2 uses the version 1 (i.e. <code class="docutils literal"><span class="pre">v1</span></code>) change streams
<a class="reference internal" href="../changeStreams.html#change-stream-resume-token"><span class="std std-ref">resume tokens</span></a>, introduced in
version 4.0.7.</p>
<p>Starting in MongoDB 4.2, change streams will throw an exception if
the <a class="reference internal" href="../changeStreams.html#change-stream-modify-output"><span class="std std-ref">change stream aggregation pipeline</span></a> modifies an event’s <a class="reference internal" href="../reference/change-events.html#change-stream-event-id"><span class="std std-ref">_id</span></a> field.</p>
</div>
<div class="section" id="id7">
<h4>Availability<a class="headerlink" href="#id7" title="Permalink to this headline">¶</a></h4>
<p>Starting in MongoDB 4.2, <a class="reference internal" href="../changeStreams.html"><span class="doc">change streams</span></a> are
available regardless of the <a class="reference internal" href="../reference/read-concern-majority.html#readconcern.&quot;majority&quot;" title="&quot;majority&quot;"><code class="xref mongodb mongodb-readconcern docutils literal"><span class="pre">&quot;majority&quot;</span></code></a> read concern
support; that is, read concern <code class="docutils literal"><span class="pre">majority</span></code> support can be either
enabled (default) or <a class="reference internal" href="../reference/read-concern-majority.html#disable-read-concern-majority"><span class="std std-ref">disabled</span></a>
to use change streams.</p>
<p>In MongoDB 4.0 and earlier, <a class="reference internal" href="../changeStreams.html"><span class="doc">change streams</span></a> are
available only if <a class="reference internal" href="../reference/read-concern-majority.html#readconcern.&quot;majority&quot;" title="&quot;majority&quot;"><code class="xref mongodb mongodb-readconcern docutils literal"><span class="pre">&quot;majority&quot;</span></code></a> read concern support is
enabled (default).</p>
</div>
<div class="section" id="change-stream-pipeline">
<h4>Change Stream Pipeline<a class="headerlink" href="#change-stream-pipeline" title="Permalink to this headline">¶</a></h4>
<p>Starting in MongoDB 4.2, you can use additional stages in the
<a class="reference internal" href="../changeStreams.html#change-stream-modify-output"><span class="std std-ref">change stream aggregation pipeline</span></a>
to modify the change stream output (i.e. the event documents):</p>
<ul class="simple">
<li><a class="reference internal" href="../reference/operator/aggregation/replaceWith.html#pipe._S_replaceWith" title="$replaceWith"><code class="xref mongodb mongodb-pipeline docutils literal"><span class="pre">$replaceWith</span></code></a></li>
<li><a class="reference internal" href="../reference/operator/aggregation/set.html#pipe._S_set" title="$set"><code class="xref mongodb mongodb-pipeline docutils literal"><span class="pre">$set</span></code></a></li>
<li><a class="reference internal" href="../reference/operator/aggregation/unset.html#pipe._S_unset" title="$unset"><code class="xref mongodb mongodb-pipeline docutils literal"><span class="pre">$unset</span></code></a></li>
</ul>
<p>Starting in MongoDB 4.2, change streams will throw an exception if
the <a class="reference internal" href="../changeStreams.html#change-stream-modify-output"><span class="std std-ref">change stream aggregation pipeline</span></a> modifies an event’s <a class="reference internal" href="../reference/change-events.html#change-stream-event-id"><span class="std std-ref">_id</span></a> field.</p>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="4.2-compatibility.html#compatibility-change-streams"><span class="std std-ref">Change Streams Compatibility Changes</span></a></p>
</div>
</div>
</div>
<div class="section" id="update-enhancements">
<h3>Update Enhancements<a class="headerlink" href="#update-enhancements" title="Permalink to this headline">¶</a></h3>
<div class="section" id="update-and-aggregation">
<span id="update-using-aggregation"></span><h4>Update and Aggregation<a class="headerlink" href="#update-and-aggregation" title="Permalink to this headline">¶</a></h4>
<p>Starting in MongoDB 4.2, you can use the aggregation pipeline for
updates in:</p>
<table border="1" class="docutils">
<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Command</th>
<th class="head"><code class="docutils literal"><span class="pre">mongo</span></code> Shell Methods</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><a class="reference internal" href="../reference/command/findAndModify.html#dbcmd.findAndModify" title="findAndModify"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">findAndModify</span></code></a></td>
<td><div class="first last line-block">
<div class="line"><a class="reference internal" href="../reference/method/db.collection.findOneAndUpdate.html#findoneandupdate-agg-pipeline"><span class="std std-ref">db.collection.findOneAndUpdate()</span></a></div>
<div class="line"><a class="reference internal" href="../reference/method/db.collection.findAndModify.html#findandmodify-agg-pipeline"><span class="std std-ref">db.collection.findAndModify()</span></a></div>
</div>
</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="../reference/command/update.html#dbcmd.update" title="update"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">update</span></code></a></td>
<td><div class="first line-block">
<div class="line"><a class="reference internal" href="../reference/method/db.collection.updateOne.html#updateone-example-agg"><span class="std std-ref">db.collection.updateOne()</span></a></div>
<div class="line"><a class="reference internal" href="../reference/method/db.collection.updateMany.html#updatemany-example-agg"><span class="std std-ref">db.collection.updateMany()</span></a></div>
<div class="line"><a class="reference internal" href="../reference/method/db.collection.update.html#update-example-agg"><span class="std std-ref">db.collection.update()</span></a></div>
</div>
<div class="last line-block">
<div class="line"><a class="reference internal" href="../reference/method/Bulk.find.update.html#example-bulk-find-update-agg"><span class="std std-ref">Bulk.find.update()</span></a></div>
<div class="line"><a class="reference internal" href="../reference/method/Bulk.find.updateOne.html#example-bulk-find-update-one-agg"><span class="std std-ref">Bulk.find.updateOne()</span></a></div>
<div class="line"><a class="reference internal" href="../reference/method/Bulk.find.upsert.html#bulk-find-upsert-update-agg-example"><span class="std std-ref">Bulk.find.upsert()</span></a></div>
</div>
</td>
</tr>
</tbody>
</table>
<p>For the updates, the pipeline can consist of the following stages:</p>
<ul class="simple">
<li><a class="reference internal" href="../reference/operator/aggregation/addFields.html#pipe._S_addFields" title="$addFields"><code class="xref mongodb mongodb-pipeline docutils literal"><span class="pre">$addFields</span></code></a> and its alias <a class="reference internal" href="../reference/operator/aggregation/set.html#pipe._S_set" title="$set"><code class="xref mongodb mongodb-pipeline docutils literal"><span class="pre">$set</span></code></a></li>
<li><a class="reference internal" href="../reference/operator/aggregation/project.html#pipe._S_project" title="$project"><code class="xref mongodb mongodb-pipeline docutils literal"><span class="pre">$project</span></code></a> and its alias <a class="reference internal" href="../reference/operator/aggregation/unset.html#pipe._S_unset" title="$unset"><code class="xref mongodb mongodb-pipeline docutils literal"><span class="pre">$unset</span></code></a></li>
<li><a class="reference internal" href="../reference/operator/aggregation/replaceRoot.html#pipe._S_replaceRoot" title="$replaceRoot"><code class="xref mongodb mongodb-pipeline docutils literal"><span class="pre">$replaceRoot</span></code></a> and its alias <a class="reference internal" href="../reference/operator/aggregation/replaceWith.html#pipe._S_replaceWith" title="$replaceWith"><code class="xref mongodb mongodb-pipeline docutils literal"><span class="pre">$replaceWith</span></code></a>.</li>
</ul>
<p>Using the aggregation pipeline allows for a more expressive update
statement, such as expressing conditional updates based on current
field values or updating one field using the value of another field(s).</p>
<p>See the individual reference pages for details and examples.</p>
</div>
<div class="section" id="update-and-hint">
<h4>Update and Hint<a class="headerlink" href="#update-and-hint" title="Permalink to this headline">¶</a></h4>
<p>Starting in MongoDB 4.2, the <a class="reference internal" href="../reference/command/update.html#dbcmd.update" title="update"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">update</span></code></a> command and the
associated <a class="reference internal" href="../reference/program/mongo.html#bin.mongo" title="bin.mongo"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongo</span></code></a> shell method
<a class="reference internal" href="../reference/method/db.collection.update.html#db.collection.update" title="db.collection.update()"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">db.collection.update()</span></code></a> can accept a hint argument to specify
the index to use. See:</p>
<ul class="simple">
<li><a class="reference internal" href="../reference/command/update.html#dbcmd.update" title="update"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">update</span></code></a></li>
<li><a class="reference internal" href="../reference/method/db.collection.update.html#db.collection.update" title="db.collection.update()"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">db.collection.update()</span></code></a></li>
</ul>
</div>
<div class="section" id="id8">
<h4>Sharded Collections and Replace Documents<a class="headerlink" href="#id8" title="Permalink to this headline">¶</a></h4>
<p>Starting in MongoDB 4.2,</p>
<ul>
<li><p class="first">Replace document operations, such as
<a class="reference internal" href="../reference/method/db.collection.replaceOne.html#db.collection.replaceOne" title="db.collection.replaceOne()"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">db.collection.replaceOne()</span></code></a> or <a class="reference internal" href="../reference/method/db.collection.update.html#update-behavior-replacement-document"><span class="std std-ref">db.collection.update(
query, replacement, … )</span></a>,
attempt to target a single shard, first by using the query filter. If the
operation cannot target a single shard by the query filter, it then
attempts to target by the replacement document.</p>
<p>In earlier versions, the operation attempts to target using the
replacement document.</p>
</li>
<li><p class="first">For a replace document operation that includes <code class="docutils literal"><span class="pre">upsert:</span> <span class="pre">true</span></code>
and is on a sharded collection, the <code class="docutils literal"><span class="pre">filter</span></code> must include an
equality match on the full shard key.</p>
</li>
</ul>
</div>
</div>
<div class="section" id="wildcard-indexes">
<span id="wildcard-releasenotes"></span><h3>Wildcard Indexes<a class="headerlink" href="#wildcard-indexes" title="Permalink to this headline">¶</a></h3>
<p>MongoDB 4.2 introduces <a class="reference internal" href="../core/index-wildcard.html#wildcard-index-core"><span class="std std-ref">wildcard indexes</span></a> for
supporting queries against fields whose names are unknown or arbitrary.</p>
<p>Consider an application that captures user-defined data under the
<code class="docutils literal"><span class="pre">userMetadata</span></code> field and supports querying against that data:</p>
<div class="button-code-block">
<div class="button-row">
</div>
<div class="highlight-javascript"><div class="highlight"><pre><span></span><span class="p">{</span> <span class="s2">&quot;userMetadata&quot;</span> <span class="o">:</span> <span class="p">{</span> <span class="s2">&quot;likes&quot;</span> <span class="o">:</span> <span class="p">[</span> <span class="s2">&quot;dogs&quot;</span><span class="p">,</span> <span class="s2">&quot;cats&quot;</span> <span class="p">]</span> <span class="p">}</span> <span class="p">}</span>
<span class="p">{</span> <span class="s2">&quot;userMetadata&quot;</span> <span class="o">:</span> <span class="p">{</span> <span class="s2">&quot;dislikes&quot;</span> <span class="o">:</span> <span class="s2">&quot;pickles&quot;</span> <span class="p">}</span> <span class="p">}</span>
<span class="p">{</span> <span class="s2">&quot;userMetadata&quot;</span> <span class="o">:</span> <span class="p">{</span> <span class="s2">&quot;age&quot;</span> <span class="o">:</span> <span class="mi">45</span> <span class="p">}</span> <span class="p">}</span>
<span class="p">{</span> <span class="s2">&quot;userMetadata&quot;</span> <span class="o">:</span> <span class="s2">&quot;inactive&quot;</span> <span class="p">}</span>
</pre></div>
</div>
</div>
<p>Administrators want to create indexes to support queries on any
subfield of <code class="docutils literal"><span class="pre">userMetadata</span></code>.</p>
<p>A wildcard index on <code class="docutils literal"><span class="pre">userMetadata</span></code>
can support single-field queries on <code class="docutils literal"><span class="pre">userMetadata</span></code>,
<code class="docutils literal"><span class="pre">userMetadata.likes</span></code>, <code class="docutils literal"><span class="pre">userMetadata.dislikes</span></code>, and
<code class="docutils literal"><span class="pre">userMetadata.age</span></code>:</p>
<div class="button-code-block">
<div class="button-row">
<a class="code-button--copy code-button" role="button">
copy</a>
</div>
<div class="copyable-code-block highlight-shell"><div class="highlight"><pre><span></span>db.userData.createIndex<span class="o">(</span> <span class="o">{</span> <span class="s2">&quot;userMetadata.</span><span class="nv">$*</span><span class="s2">*&quot;</span> : <span class="m">1</span> <span class="o">}</span> <span class="o">)</span>
</pre></div>
</div>
</div>
<p>The index can support the following queries:</p>
<div class="button-code-block">
<div class="button-row">
</div>
<div class="highlight-shell"><div class="highlight"><pre><span></span>db.userData.find<span class="o">({</span> <span class="s2">&quot;userMetadata.likes&quot;</span> : <span class="s2">&quot;dogs&quot;</span> <span class="o">})</span>
db.userData.find<span class="o">({</span> <span class="s2">&quot;userMetadata.dislikes&quot;</span> : <span class="s2">&quot;pickles&quot;</span> <span class="o">})</span>
db.userData.find<span class="o">({</span> <span class="s2">&quot;userMetadata.age&quot;</span> : <span class="o">{</span> <span class="nv">$gt</span> : <span class="m">30</span> <span class="o">}</span> <span class="o">})</span>
db.userData.find<span class="o">({</span> <span class="s2">&quot;userMetadata&quot;</span> : <span class="s2">&quot;inactive&quot;</span> <span class="o">})</span>
</pre></div>
</div>
</div>
<p>A non-wildcard index on <code class="docutils literal"><span class="pre">userMetadata</span></code> can only support queries on
values of <code class="docutils literal"><span class="pre">userMetadata</span></code>.</p>
<div class="admonition important">
<p class="first admonition-title">Important</p>
<p class="last">Wildcard indexes are not designed to replace workload-based index
planning. For more information on creating indexes to support
queries, see <a class="reference internal" href="../tutorial/create-indexes-to-support-queries.html#create-indexes-to-support-queries"><span class="std std-ref">Create Indexes to Support Your Queries</span></a>. For
complete documentation on wildcard index limitations, see
<a class="reference internal" href="../reference/index-wildcard-restrictions.html#wildcard-index-restrictions"><span class="std std-ref">Wildcard Index Restrictions</span></a>.</p>
</div>
<p>The <a class="reference internal" href="../reference/program/mongod.html#bin.mongod" title="bin.mongod"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongod</span></code></a>
<a class="reference internal" href="../reference/command/setFeatureCompatibilityVersion.html#view-fcv"><span class="std std-ref">featureCompatibilityVersion</span></a> must be <code class="docutils literal"><span class="pre">4.2</span></code> to
create wildcard indexes. For instructions on setting the fCV, see
<a class="reference internal" href="../reference/command/setFeatureCompatibilityVersion.html#set-fcv"><span class="std std-ref">Set Feature Compatibility Version on MongoDB 4.2 Deployments</span></a>.</p>
<p>You can create a wildcard index using the <a class="reference internal" href="../reference/command/createIndexes.html#dbcmd.createIndexes" title="createIndexes"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">createIndexes</span></code></a>
database command or its shell helpers
<a class="reference internal" href="../reference/method/db.collection.createIndex.html#db.collection.createIndex" title="db.collection.createIndex()"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">db.collection.createIndex()</span></code></a> and
<a class="reference internal" href="../reference/method/db.collection.createIndexes.html#db.collection.createIndexes" title="db.collection.createIndexes()"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">db.collection.createIndexes()</span></code></a>. For examples of creating
a wildcard index, see <a class="reference internal" href="../reference/method/db.collection.createIndex.html#createindex-method-wildcard-examples"><span class="std std-ref">Create a Wildcard Index</span></a>.</p>
<p>See <a class="reference internal" href="../core/index-wildcard.html#wildcard-index-core"><span class="std std-ref">Wildcard Indexes</span></a> for complete documentation.</p>
</div>
<div class="section" id="platform-support">
<h3>Platform Support<a class="headerlink" href="#platform-support" title="Permalink to this headline">¶</a></h3>
<ul class="simple">
<li>MongoDB 4.2 adds support for:<ul>
<li>Ubuntu 18.04 on ARM64</li>
</ul>
</li>
<li>MongoDB 4.2 removes support for:<ul>
<li>Debian 8</li>
<li>Ubuntu 14.04</li>
<li>Ubuntu 16.04 ARM64 for MongoDB Community Edition</li>
<li>Ubuntu 16.04 POWER/PPC64LE (Also removed in version 3.6.13 and 3.4.21)</li>
<li>macOS 10.11</li>
</ul>
</li>
</ul>
<p>See <a class="reference internal" href="../installation.html#mongodb-supported-platforms"><span class="std std-ref">Supported Platforms</span></a>.</p>
</div>
<div class="section" id="mongodb-tools">
<h3>MongoDB Tools<a class="headerlink" href="#mongodb-tools" title="Permalink to this headline">¶</a></h3>
<div class="section" id="fips-mode">
<h4>FIPS Mode<a class="headerlink" href="#fips-mode" title="Permalink to this headline">¶</a></h4>
<p>Starting in version 4.2, MongoDB removes the <code class="docutils literal"><span class="pre">--sslFIPSMode</span></code>
option for the following programs:</p>
<ul class="simple">
<li><a class="reference internal" href="../reference/program/mongodump.html#bin.mongodump" title="bin.mongodump"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongodump</span></code></a></li>
<li><a class="reference internal" href="../reference/program/mongoexport.html#bin.mongoexport" title="bin.mongoexport"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongoexport</span></code></a></li>
<li><a class="reference internal" href="../reference/program/mongofiles.html#bin.mongofiles" title="bin.mongofiles"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongofiles</span></code></a></li>
<li><a class="reference internal" href="../reference/program/mongoimport.html#bin.mongoimport" title="bin.mongoimport"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongoimport</span></code></a></li>
<li><a class="reference internal" href="../reference/program/mongorestore.html#bin.mongorestore" title="bin.mongorestore"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongorestore</span></code></a></li>
<li><a class="reference internal" href="../reference/program/mongostat.html#bin.mongostat" title="bin.mongostat"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongostat</span></code></a></li>
<li><a class="reference internal" href="../reference/program/mongotop.html#bin.mongotop" title="bin.mongotop"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongotop</span></code></a></li>
</ul>
<p>The programs will use FIPS compliant connections to
<a class="reference internal" href="../reference/program/mongod.html#bin.mongod" title="bin.mongod"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongod</span></code></a>/<a class="reference internal" href="../reference/program/mongos.html#bin.mongos" title="bin.mongos"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongos</span></code></a> if the
<a class="reference internal" href="../reference/program/mongod.html#bin.mongod" title="bin.mongod"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongod</span></code></a>/<a class="reference internal" href="../reference/program/mongos.html#bin.mongos" title="bin.mongos"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongos</span></code></a> instances are
<a class="reference internal" href="../tutorial/configure-fips.html"><span class="doc">configured to use FIPS mode</span></a>.</p>
</div>
<div class="section" id="uri-option">
<h4><code class="docutils literal"><span class="pre">--uri</span></code> Option<a class="headerlink" href="#uri-option" title="Permalink to this headline">¶</a></h4>
<p>Starting in version 4.2,</p>
<ul class="simple">
<li>For the following command-line tools, if the write concern is
specified in both the <code class="docutils literal"><span class="pre">--uri</span></code> connection string and the
<code class="docutils literal"><span class="pre">--writeConcern</span></code> option, the <code class="docutils literal"><span class="pre">--writeConcern</span></code> option overrides
the one in the connection string:<ul>
<li><a class="reference internal" href="../reference/program/mongofiles.html#bin.mongofiles" title="bin.mongofiles"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongofiles</span></code></a></li>
<li><a class="reference internal" href="../reference/program/mongoimport.html#bin.mongoimport" title="bin.mongoimport"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongoimport</span></code></a></li>
<li><a class="reference internal" href="../reference/program/mongorestore.html#bin.mongorestore" title="bin.mongorestore"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongorestore</span></code></a></li>
</ul>
</li>
<li>For the following command-line tools, if the read preference is
specified in both the <code class="docutils literal"><span class="pre">--uri</span></code> connection string and the
<code class="docutils literal"><span class="pre">--readPreference</span></code> option, the <code class="docutils literal"><span class="pre">--readPreference</span></code> option
overrides the one in the connection string:<ul>
<li><a class="reference internal" href="../reference/program/mongodump.html#bin.mongodump" title="bin.mongodump"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongodump</span></code></a></li>
<li><a class="reference internal" href="../reference/program/mongoexport.html#bin.mongoexport" title="bin.mongoexport"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongoexport</span></code></a></li>
<li><a class="reference internal" href="../reference/program/mongofiles.html#bin.mongofiles" title="bin.mongofiles"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongofiles</span></code></a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="extended-json-v2">
<h4>Extended JSON v2<a class="headerlink" href="#extended-json-v2" title="Permalink to this headline">¶</a></h4>
<p>Starting in version 4.2:</p>
<table border="1" class="colwidths-given docutils">
<colgroup>
<col width="20%" />
<col width="80%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td><a class="reference internal" href="../reference/program/bsondump.html#bin.bsondump" title="bin.bsondump"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">bsondump</span></code></a></td>
<td>Uses Extended JSON v2.0 (Canonical
mode) format.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="../reference/program/mongodump.html#bin.mongodump" title="bin.mongodump"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongodump</span></code></a></td>
<td><p class="first">Use Extended JSON v2.0 (Canonical mode) format for the
metadata. Requires <a class="reference internal" href="../reference/program/mongorestore.html#bin.mongorestore" title="bin.mongorestore"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongorestore</span></code></a> version 4.2+
that supports Extended JSON v2.0 (Canonical mode or
Relaxed) format.</p>
<div class="admonition-tip last admonition">
<p class="first admonition-title">Tip</p>
<p class="last">In general, use corresponding versions of
<a class="reference internal" href="../reference/program/mongodump.html#bin.mongodump" title="bin.mongodump"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongodump</span></code></a> and <a class="reference internal" href="../reference/program/mongorestore.html#bin.mongorestore" title="bin.mongorestore"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongorestore</span></code></a>.
That is, to restore data files created with a specific
version of <a class="reference internal" href="../reference/program/mongodump.html#bin.mongodump" title="bin.mongodump"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongodump</span></code></a>, use the corresponding
version of <a class="reference internal" href="../reference/program/mongorestore.html#bin.mongorestore" title="bin.mongorestore"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongorestore</span></code></a>.</p>
</div>
</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="../reference/program/mongoexport.html#bin.mongoexport" title="bin.mongoexport"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongoexport</span></code></a></td>
<td><div class="first line-block">
<div class="line">Creates output data in Extended JSON v2.0 (Relaxed mode) by
default.</div>
</div>
<div class="last line-block">
<div class="line">Creates output data in Extended JSON v2.0 (Canonical mode) if
used with <a class="reference internal" href="../reference/program/mongoexport.html#cmdoption-mongoexport-jsonformat"><code class="xref std std-option docutils literal"><span class="pre">--jsonFormat</span> <span class="pre">canonical</span></code></a>.</div>
</div>
</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="../reference/program/mongoimport.html#bin.mongoimport" title="bin.mongoimport"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongoimport</span></code></a></td>
<td><div class="first line-block">
<div class="line">Expects import data to be in Extended JSON v2.0 (either
Relaxed or Canonical mode) by default.</div>
</div>
<div class="line-block">
<div class="line">Can recognize data that is in Extended JSON v1.0 format if the option
<a class="reference internal" href="../reference/program/mongoimport.html#cmdoption-mongoimport-legacy"><code class="xref std std-option docutils literal"><span class="pre">--legacy</span></code></a> is specified.</div>
</div>
<div class="admonition-tip last admonition">
<p class="first admonition-title">Tip</p>
<p class="last">In general, the versions of <a class="reference internal" href="../reference/program/mongoexport.html#bin.mongoexport" title="bin.mongoexport"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongoexport</span></code></a> and
<a class="reference internal" href="../reference/program/mongoimport.html#bin.mongoimport" title="bin.mongoimport"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongoimport</span></code></a> should match. That is, to import
data created from <a class="reference internal" href="../reference/program/mongoexport.html#bin.mongoexport" title="bin.mongoexport"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongoexport</span></code></a>, you should use
the corresponding version of <a class="reference internal" href="../reference/program/mongoimport.html#bin.mongoimport" title="bin.mongoimport"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongoimport</span></code></a>.</p>
</div>
</td>
</tr>
</tbody>
</table>
<p>For details on MongoDB extended JSON v2, see
<a class="reference internal" href="../reference/mongodb-extended-json.html"><span class="doc">MongoDB Extended JSON (v2)</span></a>.</p>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="4.2-compatibility.html#compatibility-v2-query"><span class="std std-ref">--query Options</span></a></p>
</div>
</div>
<div class="section" id="mongofiles">
<h4><code class="docutils literal"><span class="pre">mongofiles</span></code><a class="headerlink" href="#mongofiles" title="Permalink to this headline">¶</a></h4>
<p>The <a class="reference internal" href="../reference/program/mongofiles.html#bin.mongofiles" title="bin.mongofiles"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongofiles</span></code></a> command <code class="docutils literal"><span class="pre">get_id</span></code> and <code class="docutils literal"><span class="pre">delete_id</span></code> can accept
both ObjectId or non-ObjectId values for the <code class="docutils literal"><span class="pre">_id</span></code>.</p>
</div>
<div class="section" id="bulk-operations-for-mongoimport-and-mongorestore">
<h4>Bulk Operations for <code class="docutils literal"><span class="pre">mongoimport</span></code> and <code class="docutils literal"><span class="pre">mongorestore</span></code><a class="headerlink" href="#bulk-operations-for-mongoimport-and-mongorestore" title="Permalink to this headline">¶</a></h4>
<div class="section" id="mongoimport">
<h5><code class="docutils literal"><span class="pre">mongoimport</span></code><a class="headerlink" href="#mongoimport" title="Permalink to this headline">¶</a></h5>
<p>Starting in version 4.2:</p>
<ul class="simple">
<li><a class="reference internal" href="../reference/program/mongoimport.html#bin.mongoimport" title="bin.mongoimport"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongoimport</span></code></a> uses maximum batch size of 100,000 to
perform bulk insert/upsert operations.</li>
<li><a class="reference internal" href="../reference/program/mongoimport.html#bin.mongoimport" title="bin.mongoimport"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongoimport</span></code></a> by default,
continues when it encounters duplicate key and document
validation errors.  To ensure that the program stops on these errors, specify <a class="reference internal" href="../reference/program/mongoimport.html#cmdoption-mongoimport-stoponerror"><code class="xref std std-option docutils literal"><span class="pre">--stopOnError</span></code></a>.</li>
<li>Specifying <a class="reference internal" href="../reference/program/mongoimport.html#cmdoption-mongoimport-maintaininsertionorder"><code class="xref std std-option docutils literal"><span class="pre">--maintainInsertionOrder</span></code></a> for <a class="reference internal" href="../reference/program/mongoimport.html#bin.mongoimport" title="bin.mongoimport"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongoimport</span></code></a>:<ul>
<li>Maintains document insertion order using ordered bulk write
operations; i.e. both the batch order and document order within the batches are maintained.  In earlier versions, only the batch order is maintained; document order within batches are not maintained.</li>
<li>Enables <a class="reference internal" href="../reference/program/mongoimport.html#cmdoption-mongoimport-stoponerror"><code class="xref std std-option docutils literal"><span class="pre">--stopOnError</span></code></a> and sets
<a class="reference internal" href="../reference/program/mongoimport.html#cmdoption-mongoimport-numinsertionworkers"><code class="xref std std-option docutils literal"><span class="pre">numInsertionWorkers</span></code></a> to
1.</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="mongorestore">
<h5><code class="docutils literal"><span class="pre">mongorestore</span></code><a class="headerlink" href="#mongorestore" title="Permalink to this headline">¶</a></h5>
<p>Starting in version 4.2:</p>
<ul class="simple">
<li><a class="reference internal" href="../reference/program/mongorestore.html#bin.mongorestore" title="bin.mongorestore"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongorestore</span></code></a> by default,
continues when it encounters duplicate key and document
validation errors.  To ensure that the program stops on these errors, specify <a class="reference internal" href="../reference/program/mongorestore.html#cmdoption-mongorestore-stoponerror"><code class="xref std std-option docutils literal"><span class="pre">--stopOnError</span></code></a>.</li>
<li>Specifying <a class="reference internal" href="../reference/program/mongorestore.html#cmdoption-mongorestore-maintaininsertionorder"><code class="xref std std-option docutils literal"><span class="pre">--maintainInsertionOrder</span></code></a> for <a class="reference internal" href="../reference/program/mongorestore.html#bin.mongorestore" title="bin.mongorestore"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongorestore</span></code></a>:<ul>
<li>Maintains document insertion order using ordered bulk write
operations; i.e. both the batch order and document order within the batches are maintained.  In earlier versions, only the batch order is maintained; document order within batches are not maintained.</li>
<li>Enables <a class="reference internal" href="../reference/program/mongorestore.html#cmdoption-mongorestore-stoponerror"><code class="xref std std-option docutils literal"><span class="pre">--stopOnError</span></code></a> and
sets <a class="reference internal" href="../reference/program/mongorestore.html#cmdoption-mongorestore-numinsertionworkerspercollection"><code class="xref std std-option docutils literal"><span class="pre">--numInsertionWorkersPerCollection</span></code></a> to 1.</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="section" id="lock-optimization-for-specific-ddl-operations">
<span id="finer-grained-locks-for-ddl"></span><h4>Lock Optimization for Specific DDL Operations<a class="headerlink" href="#lock-optimization-for-specific-ddl-operations" title="Permalink to this headline">¶</a></h4>
<p>Starting with MongoDB 4.2, the following operations take an
exclusive collection lock instead of an exclusive database lock:</p>
<table border="1" class="docutils">
<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td>Commands</td>
<td>Methods</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="../reference/command/create.html#dbcmd.create" title="create"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">create</span></code></a></td>
<td><p class="first"><a class="reference internal" href="../reference/method/db.createCollection.html#db.createCollection" title="db.createCollection()"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">db.createCollection()</span></code></a></p>
<p class="last"><a class="reference internal" href="../reference/method/db.createView.html#db.createView" title="db.createView()"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">db.createView()</span></code></a></p>
</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="../reference/command/createIndexes.html#dbcmd.createIndexes" title="createIndexes"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">createIndexes</span></code></a></td>
<td><p class="first"><a class="reference internal" href="../reference/method/db.collection.createIndex.html#db.collection.createIndex" title="db.collection.createIndex()"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">db.collection.createIndex()</span></code></a></p>
<p class="last"><a class="reference internal" href="../reference/method/db.collection.createIndexes.html#db.collection.createIndexes" title="db.collection.createIndexes()"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">db.collection.createIndexes()</span></code></a></p>
</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="../reference/command/drop.html#dbcmd.drop" title="drop"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">drop</span></code></a></td>
<td><a class="reference internal" href="../reference/method/db.collection.drop.html#db.collection.drop" title="db.collection.drop()"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">db.collection.drop()</span></code></a></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="../reference/command/dropIndexes.html#dbcmd.dropIndexes" title="dropIndexes"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">dropIndexes</span></code></a></td>
<td><p class="first"><a class="reference internal" href="../reference/method/db.collection.dropIndex.html#db.collection.dropIndex" title="db.collection.dropIndex()"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">db.collection.dropIndex()</span></code></a></p>
<p class="last"><a class="reference internal" href="../reference/method/db.collection.dropIndexes.html#db.collection.dropIndexes" title="db.collection.dropIndexes()"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">db.collection.dropIndexes()</span></code></a></p>
</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="../reference/command/renameCollection.html#dbcmd.renameCollection" title="renameCollection"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">renameCollection</span></code></a></td>
<td><a class="reference internal" href="../reference/method/db.collection.renameCollection.html#db.collection.renameCollection" title="db.collection.renameCollection()"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">db.collection.renameCollection()</span></code></a></td>
</tr>
</tbody>
</table>
<p>Prior to MongoDB 4.2, these operations took an exclusive lock on the
database, blocking all operations on the database <em>and</em> its collections
until the operation completed.</p>
<p id="traffic-recorder">In earlier versions, <code class="docutils literal"><span class="pre">get_id</span></code> and <code class="docutils literal"><span class="pre">delete_id</span></code> can only accept
ObjectId values for the <code class="docutils literal"><span class="pre">_id</span></code>.</p>
</div>
</div>
<div class="section" id="monitoring">
<h3>Monitoring<a class="headerlink" href="#monitoring" title="Permalink to this headline">¶</a></h3>
<p>Starting in version 4.2, the <a class="reference internal" href="../administration/monitoring.html#storage-node-watchdog"><span class="std std-ref">Storage Node Watchdog</span></a> is available in both the MongoDB Community
edition and the MongoDB Enterprise edition.</p>
<p>In earlier versions, the feature is available in the MongoDB Enterprise
edition only.</p>
</div>
<div class="section" id="flow-control">
<h3>Flow Control<a class="headerlink" href="#flow-control" title="Permalink to this headline">¶</a></h3>
<p>MongoDB 4.2 introduces a flow control mechanism to control the rate at
which the primary applies its writes in order to keep the
<a class="reference internal" href="../reference/command/replSetGetStatus.html#replSetGetStatus.optimes.lastCommittedOpTime" title="replSetGetStatus.optimes.lastCommittedOpTime"><code class="xref mongodb mongodb-data docutils literal"><span class="pre">majority</span> <span class="pre">committed</span></code></a>
lag under a specified maximum value.</p>
<p>Flow control is <a class="reference internal" href="../reference/parameters.html#param.enableFlowControl" title="enableFlowControl"><code class="xref mongodb mongodb-parameter docutils literal"><span class="pre">enabled</span></code></a> by default.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">For flow control to engage, the replica set/sharded cluster must
have: <a class="reference internal" href="../reference/command/setFeatureCompatibilityVersion.html#view-fcv"><span class="std std-ref">featureCompatibilityVersion (FCV)</span></a> of
<code class="docutils literal"><span class="pre">4.2</span></code> and read concern <a class="reference internal" href="../reference/configuration-options.html#replication.enableMajorityReadConcern" title="replication.enableMajorityReadConcern"><code class="xref mongodb mongodb-setting docutils literal"><span class="pre">majority</span> <span class="pre">enabled</span></code></a>. That is, enabled flow
control has no effect if FCV is not <code class="docutils literal"><span class="pre">4.2</span></code> or if read concern
majority is disabled.</p>
</div>
<p>For more information, see <a class="reference internal" href="../replication.html#replication-flow-control"><span class="std std-ref">Replication Lag and Flow Control</span></a>.</p>
</div>
<div class="section" id="logging-and-diagnostics">
<h3>Logging and Diagnostics<a class="headerlink" href="#logging-and-diagnostics" title="Permalink to this headline">¶</a></h3>
<div class="section" id="logging">
<h4>Logging<a class="headerlink" href="#logging" title="Permalink to this headline">¶</a></h4>
<ul>
<li><p class="first">Added <a class="reference internal" href="../reference/log-messages.html#INITSYNC" title="INITSYNC"><code class="xref mongodb mongodb-data docutils literal"><span class="pre">INITSYNC</span></code></a> component to log messages.</p>
</li>
<li><p class="first">Added <a class="reference internal" href="../reference/log-messages.html#ELECTION" title="ELECTION"><code class="xref mongodb mongodb-data docutils literal"><span class="pre">ELECTION</span></code></a> component to log messages.</p>
</li>
<li><p class="first">For debug messages, include the verbosity level (i.e. <code class="docutils literal"><span class="pre">D</span></code>[1-5]).
For example, if verbosity level is 2, MongoDB logs <code class="docutils literal"><span class="pre">D2</span></code>. In
previous versions, MongoDB log messages only specified <code class="docutils literal"><span class="pre">D</span></code> for
Debug level.</p>
</li>
<li><p class="first">When logging to <a class="reference internal" href="../reference/program/mongod.html#cmdoption-mongod-syslog"><code class="xref std std-option docutils literal"><span class="pre">syslog</span></code></a>, the format of the
message text includes the <a class="reference internal" href="../reference/log-messages.html#log-message-components"><span class="std std-ref">component</span></a>.
For example:</p>
<div class="button-code-block">
<div class="button-row">
<a class="code-button--copy code-button" role="button">
copy</a>
</div>
<div class="copyable-code-block highlight-none"><div class="highlight"><pre><span></span>...  ACCESS   [repl writer worker 5] Unsupported modification to roles collection ...
</pre></div>
</div>
</div>
<p>Previously, the <a class="reference internal" href="../reference/program/mongod.html#cmdoption-mongod-syslog"><code class="xref std std-option docutils literal"><span class="pre">syslog</span></code></a> message text did
not include the component. For
example:</p>
<div class="button-code-block">
<div class="button-row">
<a class="code-button--copy code-button" role="button">
copy</a>
</div>
<div class="copyable-code-block highlight-none"><div class="highlight"><pre><span></span>... [repl writer worker 1] Unsupported modification to roles collection ...
</pre></div>
</div>
</div>
</li>
<li><p class="first">MongoDB 4.2 adds a <code class="docutils literal"><span class="pre">usedDisk</span></code> indicator to the <a class="reference internal" href="../tutorial/manage-the-database-profiler.html"><span class="doc">profiler log
messages</span></a> and
<a class="reference internal" href="../reference/log-messages.html"><span class="doc">diagnostic log messages</span></a> for the
<a class="reference internal" href="../reference/command/aggregate.html#dbcmd.aggregate" title="aggregate"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">aggregate</span></code></a> operation. The <code class="docutils literal"><span class="pre">usedDisk</span></code> indicates whether
any stages of an <a class="reference internal" href="../reference/command/aggregate.html#dbcmd.aggregate" title="aggregate"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">aggregate</span></code></a> operation wrote data to
temporary files due to memory restrictions. For more information on
aggregation memory restrictions, see <a class="reference internal" href="../core/aggregation-pipeline-limits.html#agg-memory-restrictions"><span class="std std-ref">Memory Restrictions</span></a>.</p>
</li>
<li><p id="slow-oplog">Starting in version 4.2 (also available starting in 4.0.6),
secondary members of a replica set now log oplog entries that take
longer than the slow operation threshold to apply. These messages are
<a class="reference internal" href="../reference/program/mongod.html#cmdoption-mongod-logpath"><code class="xref std std-option docutils literal"><span class="pre">logged</span></code></a> for the secondaries under the
<a class="reference internal" href="../reference/log-messages.html#REPL" title="REPL"><code class="xref mongodb mongodb-data docutils literal"><span class="pre">REPL</span></code></a> component with the text <code class="docutils literal"><span class="pre">applied</span> <span class="pre">op:</span> <span class="pre">&lt;oplog</span> <span class="pre">entry&gt;</span> <span class="pre">took</span>
<span class="pre">&lt;num&gt;ms</span></code>.</p>
<div class="button-code-block">
<div class="button-row">
<a class="code-button--copy code-button" role="button">
copy</a>
</div>
<div class="copyable-code-block highlight-none"><div class="highlight"><pre><span></span>2018-11-16T12:31:35.886-0500 I REPL   [repl writer worker 13] applied op: command { ... }, took 112ms
</pre></div>
</div>
</div>
<p>The slow oplog application logging on secondaries are:</p>
<ul class="simple">
<li>Not affected by the
<a class="reference internal" href="../reference/configuration-options.html#operationProfiling.slowOpSampleRate" title="operationProfiling.slowOpSampleRate"><code class="xref mongodb mongodb-setting docutils literal"><span class="pre">slowOpSampleRate</span></code></a>; i.e. all slow
oplog entries are logged by the secondary.</li>
<li>Not affected by the
<a class="reference internal" href="../reference/parameters.html#param.logLevel" title="logLevel"><code class="xref mongodb mongodb-parameter docutils literal"><span class="pre">logLevel</span></code></a>/<a class="reference internal" href="../reference/configuration-options.html#systemLog.verbosity" title="systemLog.verbosity"><code class="xref mongodb mongodb-setting docutils literal"><span class="pre">systemLog.verbosity</span></code></a> level (or the
<a class="reference internal" href="../reference/configuration-options.html#systemLog.component.replication.verbosity" title="systemLog.component.replication.verbosity"><code class="xref mongodb mongodb-setting docutils literal"><span class="pre">systemLog.component.replication.verbosity</span></code></a> level); i.e.
for oplog entries, the secondary logs only the slow oplog entries.
Increasing the verbosity level does not log all oplog entries.</li>
<li>Not captured by the <a class="reference internal" href="../tutorial/manage-the-database-profiler.html"><span class="doc">profiler</span></a> and not affected by the
profiling level.</li>
</ul>
<p>For more information on setting the slow operation threshold, see</p>
<ul class="simple">
<li><a class="reference internal" href="../reference/program/mongod.html#cmdoption-mongod-slowms"><code class="xref std std-option docutils literal"><span class="pre">mongod</span> <span class="pre">--slowms</span></code></a></li>
<li><a class="reference internal" href="../reference/configuration-options.html#operationProfiling.slowOpThresholdMs" title="operationProfiling.slowOpThresholdMs"><code class="xref mongodb mongodb-setting docutils literal"><span class="pre">slowOpThresholdMs</span></code></a></li>
<li>The <a class="reference internal" href="../reference/command/profile.html#dbcmd.profile" title="profile"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">profile</span></code></a> command or
<a class="reference internal" href="../reference/method/db.setProfilingLevel.html#db.setProfilingLevel" title="db.setProfilingLevel()"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">db.setProfilingLevel()</span></code></a> shell helper method.</li>
</ul>
</li>
<li><p class="first">Starting in MongoDB 4.2, the <a class="reference internal" href="../reference/command/getLog.html#dbcmd.getLog" title="getLog"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">getLog</span></code></a> command truncates
any event that contains more than 1024 characters. In earlier
versions, <a class="reference internal" href="../reference/command/getLog.html#dbcmd.getLog" title="getLog"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">getLog</span></code></a> truncates after 512 characters.</p>
</li>
<li><p class="first">Starting in MongoDB 4.2 (and in 4.0.9), for slow operations, the <a class="reference internal" href="../tutorial/manage-the-database-profiler.html"><span class="doc">profiler
entries</span></a> and
<a class="reference internal" href="../reference/log-messages.html"><span class="doc">diagnostic log messages</span></a> include
<a class="reference internal" href="../reference/database-profiler.html#system.profile.storage" title="system.profile.storage"><code class="xref mongodb mongodb-data docutils literal"><span class="pre">storage</span></code></a> information.</p>
</li>
<li><p class="first">Starting in MongoDB 4.2, the <a class="reference internal" href="../tutorial/manage-the-database-profiler.html"><span class="doc">profiler entries</span></a> and the <a class="reference internal" href="../reference/log-messages.html#log-message-slow-ops"><span class="std std-ref">diagnostic
log messages (i.e. mongod/mongos log
messages)</span></a> for read/write operations include:</p>
<ul class="simple">
<li><code class="docutils literal"><span class="pre">queryHash</span></code> to help identify slow queries with the same
<a class="reference internal" href="../reference/glossary.html#term-query-shape"><span class="xref std std-term">query shape</span></a>.</li>
<li><code class="docutils literal"><span class="pre">planCacheKey</span></code> to provide more insight into the <a class="reference internal" href="../core/query-plans.html"><span class="doc">query plan
cache</span></a> for slow queries.</li>
</ul>
<p>See <a class="reference internal" href="#query-plans"><span class="std std-ref">Query Plan Improvements</span></a>.</p>
</li>
</ul>
</div>
<div class="section" id="currentop">
<span id="id9"></span><h4><code class="docutils literal"><span class="pre">currentOp</span></code><a class="headerlink" href="#currentop" title="Permalink to this headline">¶</a></h4>
<p>MongoDB 4.2 adds a new option <code class="docutils literal"><span class="pre">idleCursors</span></code> to the
<a class="reference internal" href="../reference/operator/aggregation/currentOp.html#pipe._S_currentOp" title="$currentOp"><code class="xref mongodb mongodb-pipeline docutils literal"><span class="pre">$currentOp</span></code></a> aggregation stage in order to return information
on idle cursors.</p>
<p>In addition, MongoDB 4.2 adds the following new fields to the documents
returned from the <a class="reference internal" href="../reference/operator/aggregation/currentOp.html#pipe._S_currentOp" title="$currentOp"><code class="xref mongodb mongodb-pipeline docutils literal"><span class="pre">$currentOp</span></code></a> aggregation stage,
<a class="reference internal" href="../reference/command/currentOp.html#dbcmd.currentOp" title="currentOp"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">currentOp</span></code></a> command, and <a class="reference internal" href="../reference/method/db.currentOp.html#db.currentOp" title="db.currentOp()"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">db.currentOp()</span></code></a> helper:</p>
<table border="1" class="docutils">
<colgroup>
<col width="33%" />
<col width="33%" />
<col width="33%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head"><code class="docutils literal"><span class="pre">$currentOp</span></code></th>
<th class="head"><code class="docutils literal"><span class="pre">currentOp</span></code>/<code class="docutils literal"><span class="pre">db.currentOp()</span></code></th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><a class="reference internal" href="../reference/operator/aggregation/currentOp.html#_S_currentOp.type" title="$currentOp.type"><code class="xref mongodb mongodb-data docutils literal"><span class="pre">$currentOp.type</span></code></a></td>
<td><a class="reference internal" href="../reference/command/currentOp.html#currentOp.type" title="currentOp.type"><code class="xref mongodb mongodb-data docutils literal"><span class="pre">currentOp.type</span></code></a></td>
<td>Specifies whether the reported operation is an <code class="docutils literal"><span class="pre">op</span></code>,
<code class="docutils literal"><span class="pre">idleSession</span></code>, or <code class="docutils literal"><span class="pre">idleCursor</span></code>.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="../reference/operator/aggregation/currentOp.html#_S_currentOp.cursor" title="$currentOp.cursor"><code class="xref mongodb mongodb-data docutils literal"><span class="pre">$currentOp.cursor</span></code></a></td>
<td><a class="reference internal" href="../reference/command/currentOp.html#currentOp.cursor" title="currentOp.cursor"><code class="xref mongodb mongodb-data docutils literal"><span class="pre">currentOp.cursor</span></code></a></td>
<td>Specifies cursor details. Available when returning <code class="docutils literal"><span class="pre">getmore</span></code>
operations or <code class="docutils literal"><span class="pre">idleCursor</span></code> information.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="../reference/operator/aggregation/currentOp.html#_S_currentOp.effectiveUsers" title="$currentOp.effectiveUsers"><code class="xref mongodb mongodb-data docutils literal"><span class="pre">$currentOp.effectiveUsers</span></code></a></td>
<td><a class="reference internal" href="../reference/command/currentOp.html#currentOp.effectiveUsers" title="currentOp.effectiveUsers"><code class="xref mongodb mongodb-data docutils literal"><span class="pre">currentOp.effectiveUsers</span></code></a></td>
<td>Specifies users associated with the operation.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="../reference/operator/aggregation/currentOp.html#_S_currentOp.prepareReadConflicts" title="$currentOp.prepareReadConflicts"><code class="xref mongodb mongodb-data docutils literal"><span class="pre">$currentOp.prepareReadConflicts</span></code></a></td>
<td><a class="reference internal" href="../reference/command/currentOp.html#currentOp.prepareReadConflicts" title="currentOp.prepareReadConflicts"><code class="xref mongodb mongodb-data docutils literal"><span class="pre">currentOp.prepareReadConflicts</span></code></a></td>
<td>Specifies the number of times the current operation had to wait
for a prepared transaction with a write to commit or abort.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="../reference/operator/aggregation/currentOp.html#_S_currentOp.runBy" title="$currentOp.runBy"><code class="xref mongodb mongodb-data docutils literal"><span class="pre">$currentOp.runBy</span></code></a></td>
<td><a class="reference internal" href="../reference/command/currentOp.html#currentOp.runBy" title="currentOp.runBy"><code class="xref mongodb mongodb-data docutils literal"><span class="pre">currentOp.runBy</span></code></a></td>
<td>Specifies users that are impersonating the effective users for
the operation.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="../reference/operator/aggregation/currentOp.html#_S_currentOp.writeConflicts" title="$currentOp.writeConflicts"><code class="xref mongodb mongodb-data docutils literal"><span class="pre">$currentOp.writeConflicts</span></code></a></td>
<td><a class="reference internal" href="../reference/command/currentOp.html#currentOp.writeConflicts" title="currentOp.writeConflicts"><code class="xref mongodb mongodb-data docutils literal"><span class="pre">currentOp.writeConflicts</span></code></a></td>
<td>Specifies the number of times the current operation conflicted
with another write operation.</td>
</tr>
</tbody>
</table>
<p>See also <a class="reference internal" href="4.2-compatibility.html#current-op-compat"><span class="std std-ref">4.2 current op compatibility changes</span></a></p>
</div>
<div class="section" id="serverstatus-metrics">
<h4><code class="docutils literal"><span class="pre">serverStatus</span></code> Metrics<a class="headerlink" href="#serverstatus-metrics" title="Permalink to this headline">¶</a></h4>
<p>Starting in MongoDB 4.2, the <a class="reference internal" href="../reference/command/serverStatus.html#dbcmd.serverStatus" title="serverStatus"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">serverStatus</span></code></a> command and the
<a class="reference internal" href="../reference/program/mongo.html#bin.mongo" title="bin.mongo"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongo</span></code></a> shell method <a class="reference internal" href="../reference/method/db.serverStatus.html#db.serverStatus" title="db.serverStatus()"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">db.serverStatus()</span></code></a> include
the following output changes:</p>
<table border="1" class="docutils">
<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td>Updates to</td>
<td>Changes</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="../reference/command/serverStatus.html#serverstatus.shardingStatistics" title="shardingStatistics"><code class="xref mongodb mongodb-serverstatus docutils literal"><span class="pre">shardingStatistics</span></code></a></td>
<td><p class="first">Added new fields:</p>
<ul class="last simple">
<li><a class="reference internal" href="../reference/command/serverStatus.html#serverstatus.shardingStatistics.countDocsClonedOnRecipient" title="shardingStatistics.countDocsClonedOnRecipient"><code class="xref mongodb mongodb-serverstatus docutils literal"><span class="pre">shardingStatistics.countDocsClonedOnRecipient</span></code></a></li>
<li><a class="reference internal" href="../reference/command/serverStatus.html#serverstatus.shardingStatistics.countDocsClonedOnDonor" title="shardingStatistics.countDocsClonedOnDonor"><code class="xref mongodb mongodb-serverstatus docutils literal"><span class="pre">shardingStatistics.countDocsClonedOnDonor</span></code></a></li>
<li><a class="reference internal" href="../reference/command/serverStatus.html#serverstatus.shardingStatistics.countDocsDeletedOnDonor" title="shardingStatistics.countDocsDeletedOnDonor"><code class="xref mongodb mongodb-serverstatus docutils literal"><span class="pre">shardingStatistics.countDocsDeletedOnDonor</span></code></a></li>
<li><a class="reference internal" href="../reference/command/serverStatus.html#serverstatus.shardingStatistics.countRecipientMoveChunkStarted" title="shardingStatistics.countRecipientMoveChunkStarted"><code class="xref mongodb mongodb-serverstatus docutils literal"><span class="pre">shardingStatistics.countRecipientMoveChunkStarted</span></code></a></li>
<li><a class="reference internal" href="../reference/command/serverStatus.html#serverstatus.shardingStatistics.countDonorMoveChunkLockTimeout" title="shardingStatistics.countDonorMoveChunkLockTimeout"><code class="xref mongodb mongodb-serverstatus docutils literal"><span class="pre">shardingStatistics.countDonorMoveChunkLockTimeout</span></code></a></li>
</ul>
</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="../reference/command/serverStatus.html#serverstatus.metrics.repl.network" title="metrics.repl.network"><code class="xref mongodb mongodb-serverstatus docutils literal"><span class="pre">metrics.repl.network</span></code></a>:</td>
<td><p class="first">Added new fields:</p>
<ul class="last simple">
<li><a class="reference internal" href="../reference/command/serverStatus.html#serverstatus.metrics.repl.network.notMasterLegacyUnacknowledgedWrites" title="metrics.repl.network.notMasterLegacyUnacknowledgedWrites"><code class="xref mongodb mongodb-serverstatus docutils literal"><span class="pre">metrics.repl.network.notMasterLegacyUnacknowledgedWrites</span></code></a></li>
<li><a class="reference internal" href="../reference/command/serverStatus.html#serverstatus.metrics.repl.network.notMasterUnacknowledgedWrites" title="metrics.repl.network.notMasterUnacknowledgedWrites"><code class="xref mongodb mongodb-serverstatus docutils literal"><span class="pre">metrics.repl.network.notMasterUnacknowledgedWrites</span></code></a></li>
</ul>
</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="../reference/command/serverStatus.html#serverstatus.metrics.repl" title="metrics.repl"><code class="xref mongodb mongodb-serverstatus docutils literal"><span class="pre">metrics.repl</span></code></a></td>
<td><p class="first">Added new <a class="reference internal" href="../reference/command/serverStatus.html#serverstatus.metrics.repl.stepDown" title="metrics.repl.stepDown"><code class="xref mongodb mongodb-serverstatus docutils literal"><span class="pre">metrics.repl.stepDown</span></code></a> metrics:</p>
<ul class="last simple">
<li><a class="reference internal" href="../reference/command/serverStatus.html#serverstatus.metrics.repl.stepDown.userOperationsKilled" title="metrics.repl.stepDown.userOperationsKilled"><code class="xref mongodb mongodb-serverstatus docutils literal"><span class="pre">metrics.repl.stepDown.userOperationsKilled</span></code></a></li>
<li><a class="reference internal" href="../reference/command/serverStatus.html#serverstatus.metrics.repl.stepDown.userOperationsRunning" title="metrics.repl.stepDown.userOperationsRunning"><code class="xref mongodb mongodb-serverstatus docutils literal"><span class="pre">metrics.repl.stepDown.userOperationsRunning</span></code></a></li>
</ul>
</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="../reference/command/serverStatus.html#serverstatus.transactions" title="transactions"><code class="xref mongodb mongodb-serverstatus docutils literal"><span class="pre">transactions</span></code></a></td>
<td><ul class="first last simple">
<li>Now available for <a class="reference internal" href="../reference/program/mongos.html#bin.mongos" title="bin.mongos"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongos</span></code></a> (previously only for
<a class="reference internal" href="../reference/program/mongod.html#bin.mongod" title="bin.mongod"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongod</span></code></a>)</li>
<li>Added new fields for <a class="reference internal" href="../reference/program/mongod.html#bin.mongod" title="bin.mongod"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongod</span></code></a> instances:<ul>
<li><a class="reference internal" href="../reference/command/serverStatus.html#serverstatus.transactions.totalPrepared" title="transactions.totalPrepared"><code class="xref mongodb mongodb-serverstatus docutils literal"><span class="pre">transactions.totalPrepared</span></code></a></li>
<li><a class="reference internal" href="../reference/command/serverStatus.html#serverstatus.transactions.totalPreparedThenCommitted" title="transactions.totalPreparedThenCommitted"><code class="xref mongodb mongodb-serverstatus docutils literal"><span class="pre">transactions.totalPreparedThenCommitted</span></code></a></li>
<li><a class="reference internal" href="../reference/command/serverStatus.html#serverstatus.transactions.totalPreparedThenAborted" title="transactions.totalPreparedThenAborted"><code class="xref mongodb mongodb-serverstatus docutils literal"><span class="pre">transactions.totalPreparedThenAborted</span></code></a></li>
<li><a class="reference internal" href="../reference/command/serverStatus.html#serverstatus.transactions.currentPrepared" title="transactions.currentPrepared"><code class="xref mongodb mongodb-serverstatus docutils literal"><span class="pre">transactions.currentPrepared</span></code></a></li>
</ul>
</li>
</ul>
</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="../reference/command/serverStatus.html#serverstatus.logicalSessionRecordCache" title="logicalSessionRecordCache"><code class="xref mongodb mongodb-serverstatus docutils literal"><span class="pre">logicalSessionRecordCache</span></code></a></td>
<td>Added new field <a class="reference internal" href="../reference/command/serverStatus.html#serverstatus.logicalSessionRecordCache.sessionCatalogSize" title="logicalSessionRecordCache.sessionCatalogSize"><code class="xref mongodb mongodb-serverstatus docutils literal"><span class="pre">logicalSessionRecordCache.sessionCatalogSize</span></code></a></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="../reference/command/serverStatus.html#serverstatus.locks" title="locks"><code class="xref mongodb mongodb-serverstatus docutils literal"><span class="pre">locks</span></code></a></td>
<td><p class="first">Separate <code class="docutils literal"><span class="pre">ParallelBatchWriterMode</span></code> from <code class="docutils literal"><span class="pre">Global</span></code>
lock information.</p>
<p class="last">Add <code class="docutils literal"><span class="pre">ReplicationStateTransition</span></code> lock information.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="replica-set-status-metrics">
<h4>Replica Set Status Metrics<a class="headerlink" href="#replica-set-status-metrics" title="Permalink to this headline">¶</a></h4>
<p>Starting in version MongoDB 4.2, <a class="reference internal" href="../reference/command/replSetGetStatus.html#dbcmd.replSetGetStatus" title="replSetGetStatus"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">replSetGetStatus</span></code></a> and its
<a class="reference internal" href="../reference/program/mongo.html#bin.mongo" title="bin.mongo"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongo</span></code></a> shell helper <a class="reference internal" href="../reference/method/rs.status.html#rs.status" title="rs.status()"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">rs.status()</span></code></a> return:</p>
<ul>
<li><p class="first">The IP address, <a class="reference internal" href="../reference/command/replSetGetStatus.html#replSetGetStatus.members[n].ip" title="replSetGetStatus.members[n].ip"><code class="xref mongodb mongodb-data docutils literal"><span class="pre">replSetGetStatus.members[n].ip</span></code></a> for the
replica set members.</p>
</li>
<li><p class="first">ISODate-formatted date string fields that correspond to the various
<a class="reference internal" href="../reference/command/replSetGetStatus.html#replSetGetStatus.optimes" title="replSetGetStatus.optimes"><code class="xref mongodb mongodb-data docutils literal"><span class="pre">replSetGetStatus.optimes</span></code></a>.</p>
<table border="1" class="docutils">
<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">New ISODate-Formatted Date String Field</th>
<th class="head">Corresponding Optime Field</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><a class="reference internal" href="../reference/command/replSetGetStatus.html#replSetGetStatus.optimes.lastCommittedWallTime" title="replSetGetStatus.optimes.lastCommittedWallTime"><code class="xref mongodb mongodb-data docutils literal"><span class="pre">lastCommittedWallTime</span></code></a></td>
<td><a class="reference internal" href="../reference/command/replSetGetStatus.html#replSetGetStatus.optimes.lastCommittedOpTime" title="replSetGetStatus.optimes.lastCommittedOpTime"><code class="xref mongodb mongodb-data docutils literal"><span class="pre">lastCommittedOpTime</span></code></a></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="../reference/command/replSetGetStatus.html#replSetGetStatus.optimes.readConcernMajorityWallTime" title="replSetGetStatus.optimes.readConcernMajorityWallTime"><code class="xref mongodb mongodb-data docutils literal"><span class="pre">readConcernMajorityWallTime</span></code></a></td>
<td><a class="reference internal" href="../reference/command/replSetGetStatus.html#replSetGetStatus.optimes.readConcernMajorityOpTime" title="replSetGetStatus.optimes.readConcernMajorityOpTime"><code class="xref mongodb mongodb-data docutils literal"><span class="pre">readConcernMajorityOpTime</span></code></a></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="../reference/command/replSetGetStatus.html#replSetGetStatus.optimes.lastAppliedWallTime" title="replSetGetStatus.optimes.lastAppliedWallTime"><code class="xref mongodb mongodb-data docutils literal"><span class="pre">lastAppliedWallTime</span></code></a></td>
<td><a class="reference internal" href="../reference/command/replSetGetStatus.html#replSetGetStatus.optimes.appliedOpTime" title="replSetGetStatus.optimes.appliedOpTime"><code class="xref mongodb mongodb-data docutils literal"><span class="pre">appliedOpTime</span></code></a></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="../reference/command/replSetGetStatus.html#replSetGetStatus.optimes.lastDurableWallTime" title="replSetGetStatus.optimes.lastDurableWallTime"><code class="xref mongodb mongodb-data docutils literal"><span class="pre">lastDurableWallTime</span></code></a></td>
<td><a class="reference internal" href="../reference/command/replSetGetStatus.html#replSetGetStatus.optimes.durableOpTime" title="replSetGetStatus.optimes.durableOpTime"><code class="xref mongodb mongodb-data docutils literal"><span class="pre">durableOpTime</span></code></a></td>
</tr>
</tbody>
</table>
</li>
</ul>
<p>MongoDB 4.2 deprecates the field
<a class="reference internal" href="../reference/command/replSetGetStatus.html#replSetGetStatus.lastStableCheckpointTimestamp" title="replSetGetStatus.lastStableCheckpointTimestamp"><code class="xref mongodb mongodb-data docutils literal"><span class="pre">lastStableCheckpointTimestamp</span></code></a> returned from
<a class="reference internal" href="../reference/command/replSetGetStatus.html#dbcmd.replSetGetStatus" title="replSetGetStatus"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">replSetGetStatus</span></code></a>.</p>
</div>
<div class="section" id="lock-diagnostics-reporting">
<h4>Lock Diagnostics Reporting<a class="headerlink" href="#lock-diagnostics-reporting" title="Permalink to this headline">¶</a></h4>
<p>Starting in version 4.2, MongoDB reports on
<code class="docutils literal"><span class="pre">ReplicationStateTransition</span></code> lock information.</p>
<p>In addition, MongoDB 4.2 separates <code class="docutils literal"><span class="pre">ParallelBatchWriterMode</span></code> lock
information from <code class="docutils literal"><span class="pre">Global</span></code> lock information. Earlier MongoDB versions
report <code class="docutils literal"><span class="pre">ParallelBatchWriterMode</span></code> lock information as part
of <code class="docutils literal"><span class="pre">Global</span></code> locks.</p>
<p>For operations that report on lock information, see:</p>
<ul class="simple">
<li><a class="reference internal" href="../reference/command/serverStatus.html#dbcmd.serverStatus" title="serverStatus"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">serverStatus</span></code></a> command and <a class="reference internal" href="../reference/method/db.serverStatus.html#db.serverStatus" title="db.serverStatus()"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">db.serverStatus()</span></code></a> method.</li>
<li><a class="reference internal" href="../reference/operator/aggregation/currentOp.html#pipe._S_currentOp" title="$currentOp"><code class="xref mongodb mongodb-pipeline docutils literal"><span class="pre">$currentOp</span></code></a> aggregation pipeline stage, <a class="reference internal" href="../reference/command/currentOp.html#dbcmd.currentOp" title="currentOp"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">currentOp</span></code></a> command, and <a class="reference internal" href="../reference/method/db.currentOp.html#db.currentOp" title="db.currentOp()"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">db.currentOp()</span></code></a> method.</li>
</ul>
</div>
<div class="section" id="collstats-improvements">
<h4><code class="docutils literal"><span class="pre">collStats</span></code> Improvements<a class="headerlink" href="#collstats-improvements" title="Permalink to this headline">¶</a></h4>
<p>Starting in MongoDB 4.2, the <a class="reference internal" href="../reference/operator/aggregation/collStats.html#pipe._S_collStats" title="$collStats"><code class="xref mongodb mongodb-pipeline docutils literal"><span class="pre">$collStats</span></code></a> aggregation, the
<a class="reference internal" href="../reference/command/collStats.html#dbcmd.collStats" title="collStats"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">collStats</span></code></a> command, and the <a class="reference internal" href="../reference/program/mongo.html#bin.mongo" title="bin.mongo"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongo</span></code></a> shell
helper <a class="reference internal" href="../reference/method/db.collection.stats.html#db.collection.stats" title="db.collection.stats"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">db.collection.stats</span></code></a> return information on indexes that
are currently being built.</p>
<p>For details, see:</p>
<ul class="simple">
<li><a class="reference internal" href="../reference/command/collStats.html#collStats.nindexes" title="collStats.nindexes"><code class="xref mongodb mongodb-data docutils literal"><span class="pre">collStats.nindexes</span></code></a></li>
<li><a class="reference internal" href="../reference/command/collStats.html#collStats.indexDetails" title="collStats.indexDetails"><code class="xref mongodb mongodb-data docutils literal"><span class="pre">collStats.indexDetails</span></code></a></li>
<li><a class="reference internal" href="../reference/command/collStats.html#collStats.indexBuilds" title="collStats.indexBuilds"><code class="xref mongodb mongodb-data docutils literal"><span class="pre">collStats.indexBuilds</span></code></a></li>
<li><a class="reference internal" href="../reference/command/collStats.html#collStats.totalIndexSize" title="collStats.totalIndexSize"><code class="xref mongodb mongodb-data docutils literal"><span class="pre">collStats.totalIndexSize</span></code></a></li>
<li><a class="reference internal" href="../reference/command/collStats.html#collStats.indexSizes" title="collStats.indexSizes"><code class="xref mongodb mongodb-data docutils literal"><span class="pre">collStats.indexSizes</span></code></a></li>
</ul>
<p>Starting in MongoDB 4.2, the <a class="reference internal" href="../reference/operator/aggregation/collStats.html#pipe._S_collStats" title="$collStats"><code class="xref mongodb mongodb-pipeline docutils literal"><span class="pre">$collStats</span></code></a> aggregation, the
<a class="reference internal" href="../reference/command/collStats.html#dbcmd.collStats" title="collStats"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">collStats</span></code></a> command, and the <a class="reference internal" href="../reference/program/mongo.html#bin.mongo" title="bin.mongo"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongo</span></code></a> shell
helper <a class="reference internal" href="../reference/method/db.collection.stats.html#db.collection.stats" title="db.collection.stats"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">db.collection.stats</span></code></a> return the <code class="docutils literal"><span class="pre">scaleFactor</span></code> used to
scale the various size data.</p>
</div>
<div class="section" id="dbstats-improvements">
<h4><code class="docutils literal"><span class="pre">dbStats</span></code> Improvements<a class="headerlink" href="#dbstats-improvements" title="Permalink to this headline">¶</a></h4>
<p>Starting in MongoDB 4.2, the <a class="reference internal" href="../reference/command/dbStats.html#dbcmd.dbStats" title="dbStats"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">dbStats</span></code></a> command, and the
<a class="reference internal" href="../reference/program/mongo.html#bin.mongo" title="bin.mongo"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongo</span></code></a> shell helper <a class="reference internal" href="../reference/method/db.stats.html#db.stats" title="db.stats()"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">db.stats()</span></code></a> return
the <code class="docutils literal"><span class="pre">scaleFactor</span></code> used to scale the various size data.</p>
</div>
</div>
<div class="section" id="general-improvements">
<h3>General Improvements<a class="headerlink" href="#general-improvements" title="Permalink to this headline">¶</a></h3>
<div class="section" id="externally-sourced-values-for-configuration-files">
<h4>Externally Sourced Values for Configuration Files<a class="headerlink" href="#externally-sourced-values-for-configuration-files" title="Permalink to this headline">¶</a></h4>
<p>MongoDB supports using
<a class="reference internal" href="../reference/expansion-directives.html#expansion-directives"><span class="std std-ref">expansion directives</span></a> in configuration
files to load externally sourced values. Expansion directives can
load values for specific
<a class="reference internal" href="../reference/configuration-options.html#configuration-options"><span class="std std-ref">configuration file options</span></a> <em>or</em> load the
entire configuration file.</p>
<p>The following expansion directives are available:</p>
<table border="1" class="colwidths-given docutils">
<colgroup>
<col width="30%" />
<col width="70%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Expansion Directive</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><a class="reference internal" href="../reference/expansion-directives.html#configexpansion.__rest" title="__rest"><code class="xref mongodb mongodb-configexpansion docutils literal"><span class="pre">__rest</span></code></a></td>
<td>Allows users to specify a <code class="docutils literal"><span class="pre">REST</span></code> endpoint as the external source
for configuration file options <em>or</em> the full configuration file.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="../reference/expansion-directives.html#configexpansion.__exec" title="__exec"><code class="xref mongodb mongodb-configexpansion docutils literal"><span class="pre">__exec</span></code></a></td>
<td>Allows users to specify a shell or terminal command as the
external source for configuration file options <em>or</em> the
full configuration file.</td>
</tr>
</tbody>
</table>
<p>For complete documentation, see <a class="reference internal" href="../reference/expansion-directives.html#externally-sourced-values"><span class="std std-ref">Externally Sourced Configuration File Values</span></a>.</p>
</div>
<div class="section" id="outputconfig-option">
<h4><code class="docutils literal"><span class="pre">outputConfig</span></code> Option<a class="headerlink" href="#outputconfig-option" title="Permalink to this headline">¶</a></h4>
<p>MongoDB 4.2 adds the <a class="reference internal" href="../reference/program/mongod.html#cmdoption-mongod-outputconfig"><code class="xref std std-option docutils literal"><span class="pre">--outputConfig</span></code></a>
option for <a class="reference internal" href="../reference/program/mongod.html#bin.mongod" title="bin.mongod"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongod</span></code></a> and <a class="reference internal" href="../reference/program/mongos.html#bin.mongos" title="bin.mongos"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongos</span></code></a>. The option
outputs to <code class="docutils literal"><span class="pre">stdout</span></code> the <a class="reference internal" href="../reference/program/mongod.html#bin.mongod" title="bin.mongod"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongod</span></code></a>/<a class="reference internal" href="../reference/program/mongos.html#bin.mongos" title="bin.mongos"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongos</span></code></a>
instance’s configuration, in YAML format.</p>
<p>If the configuration uses any <a class="reference internal" href="../reference/expansion-directives.html#externally-sourced-values"><span class="std std-ref">Externally Sourced Configuration File Values</span></a>, the
option returns the resolved value for those options.</p>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">This may include any configured passwords or secrets previously
obfuscated through the external source.</p>
</div>
<p>For usage examples, see:</p>
<ul class="simple">
<li><a class="reference internal" href="../reference/expansion-directives.html#expansion-directive-output"><span class="std std-ref">Output the Configuration File with Resolved Expansion Directive Values</span></a></li>
<li><a class="reference internal" href="../tutorial/convert-command-line-options-to-yaml.html"><span class="doc">Convert Command-Line Options to YAML</span></a></li>
</ul>
</div>
<div class="section" id="remove-index-key-size-limit">
<h4>Remove Index Key Size Limit<a class="headerlink" href="#remove-index-key-size-limit" title="Permalink to this headline">¶</a></h4>
<p>Starting in MongoDB 4.2, for <a class="reference internal" href="../reference/command/setFeatureCompatibilityVersion.html#view-fcv"><span class="std std-ref">featureCompatibilityVersion</span></a> set to <code class="docutils literal"><span class="pre">&quot;4.2&quot;</span></code> or greater, MongoDB removes the
<a class="reference internal" href="../reference/limits.html#Index-Key-Limit" title="Index Key Limit"><code class="xref mongodb mongodb-limit docutils literal"><span class="pre">Index</span> <span class="pre">Key</span> <span class="pre">Limit</span></code></a>. For fCV set to <code class="docutils literal"><span class="pre">&quot;4.0&quot;</span></code>, the limit still
applies.</p>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="4.2-compatibility.html#index-compat-changes"><span class="std std-ref">4.2 Indexes Compatibility Changes</span></a></p>
</div>
</div>
<div class="section" id="remove-index-name-length-limit">
<h4>Remove Index Name Length Limit<a class="headerlink" href="#remove-index-name-length-limit" title="Permalink to this headline">¶</a></h4>
<p>Starting in version 4.2, for <a class="reference internal" href="../reference/command/setFeatureCompatibilityVersion.html#view-fcv"><span class="std std-ref">featureCompatibilityVersion</span></a> set to <code class="docutils literal"><span class="pre">&quot;4.2&quot;</span></code> or greater, MongoDB removes the
<a class="reference internal" href="../reference/limits.html#Index-Name-Length" title="Index Name Length"><code class="xref mongodb mongodb-limit docutils literal"><span class="pre">Index</span> <span class="pre">Name</span> <span class="pre">Length</span></code></a> limit of 127 byte maximum. In previous
versions or MongoDB versions with
<a class="reference internal" href="../reference/command/setFeatureCompatibilityVersion.html#view-fcv"><span class="std std-ref">featureCompatibilityVersion</span></a> (fCV) set to
<code class="docutils literal"><span class="pre">&quot;4.0&quot;</span></code>, index names must fall within the
<a class="reference internal" href="../reference/limits.html#Index-Name-Length" title="Index Name Length"><code class="xref mongodb mongodb-limit docutils literal"><span class="pre">limit</span></code></a>.</p>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="4.2-compatibility.html#index-compat-changes"><span class="std std-ref">4.2 Indexes Compatibility Changes</span></a>,
<a class="reference internal" href="4.2-compatibility.html#compatibility-enabled"><span class="std std-ref">4.2 Feature Compatibility</span></a></p>
</div>
</div>
<div class="section" id="improvements-to-dropindexes">
<h4>Improvements to <code class="docutils literal"><span class="pre">dropIndexes</span></code><a class="headerlink" href="#improvements-to-dropindexes" title="Permalink to this headline">¶</a></h4>
<div class="section" id="drop-multiple-indexes">
<h5>Drop multiple indexes<a class="headerlink" href="#drop-multiple-indexes" title="Permalink to this headline">¶</a></h5>
<p>Starting in MongoDB 4.2, you can specify multiple indexes to the
<a class="reference internal" href="../reference/command/dropIndexes.html#dbcmd.dropIndexes" title="dropIndexes"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">dropIndexes</span></code></a> command and its <a class="reference internal" href="../reference/program/mongo.html#bin.mongo" title="bin.mongo"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongo</span></code></a> shell
helper <a class="reference internal" href="../reference/method/db.collection.dropIndexes.html#db.collection.dropIndexes" title="db.collection.dropIndexes()"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">db.collection.dropIndexes()</span></code></a>. To specify multiple
indexes to drop, pass an array of index names to
<a class="reference internal" href="../reference/command/dropIndexes.html#dbcmd.dropIndexes" title="dropIndexes"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">dropIndexes</span></code></a>/<a class="reference internal" href="../reference/method/db.collection.dropIndexes.html#db.collection.dropIndexes" title="db.collection.dropIndexes()"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">db.collection.dropIndexes()</span></code></a>.</p>
</div>
<div class="section" id="kill-related-queries-only">
<h5>Kill related queries only<a class="headerlink" href="#kill-related-queries-only" title="Permalink to this headline">¶</a></h5>
<p>Starting in MongoDB 4.2, the <a class="reference internal" href="../reference/command/dropIndexes.html#dbcmd.dropIndexes" title="dropIndexes"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">dropIndexes</span></code></a> or its shell helpers <a class="reference internal" href="../reference/method/db.collection.dropIndex.html#db.collection.dropIndex" title="db.collection.dropIndex()"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">dropIndex()</span></code></a> and <a class="reference internal" href="../reference/method/db.collection.dropIndexes.html#db.collection.dropIndexes" title="db.collection.dropIndexes()"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">dropIndexes()</span></code></a> operation only kills
queries that are using the index being dropped. This may include
queries considering the index as part of
<a class="reference internal" href="../core/query-plans.html#query-plans-query-optimization"><span class="std std-ref">query planning</span></a>.</p>
<p>Prior to MongoDB 4.2, dropping an index on a
collection would kill all open queries on the collection.</p>
</div>
</div>
<div class="section" id="zstd-availability">
<h4><code class="docutils literal"><span class="pre">zstd</span></code> Availability<a class="headerlink" href="#zstd-availability" title="Permalink to this headline">¶</a></h4>
<p>Starting in version 4.2, MongoDB supports <a class="reference internal" href="../reference/glossary.html#term-zstd"><span class="xref std std-term">zstd</span></a> for:</p>
<ul class="simple">
<li>block compression. See
<a class="reference internal" href="../reference/configuration-options.html#storage.wiredTiger.collectionConfig.blockCompressor" title="storage.wiredTiger.collectionConfig.blockCompressor"><code class="xref mongodb mongodb-setting docutils literal"><span class="pre">storage.wiredTiger.collectionConfig.blockCompressor</span></code></a>.</li>
<li>journal compression. See
<a class="reference internal" href="../reference/configuration-options.html#storage.wiredTiger.engineConfig.journalCompressor" title="storage.wiredTiger.engineConfig.journalCompressor"><code class="xref mongodb mongodb-setting docutils literal"><span class="pre">storage.wiredTiger.engineConfig.journalCompressor</span></code></a>.</li>
<li>network compression. See <a class="reference internal" href="../reference/configuration-options.html#net.compression.compressors" title="net.compression.compressors"><code class="xref mongodb mongodb-setting docutils literal"><span class="pre">net.compression.compressors</span></code></a>.<ul>
<li>For clients using the MongoDB drivers, they must use drivers
updated for MongoDB 4.2.</li>
<li>The network compressors for <a class="reference internal" href="../reference/program/mongod.html#bin.mongod" title="bin.mongod"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongod</span></code></a> and
<a class="reference internal" href="../reference/program/mongos.html#bin.mongos" title="bin.mongos"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongos</span></code></a> default to both <code class="docutils literal"><span class="pre">snappy,zstd,zlib</span></code>
compressors, in that order. In version 4.0, <a class="reference internal" href="../reference/program/mongod.html#bin.mongod" title="bin.mongod"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongod</span></code></a>
and <a class="reference internal" href="../reference/program/mongos.html#bin.mongos" title="bin.mongos"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongos</span></code></a> enable network compression by default
with <code class="docutils literal"><span class="pre">snappy</span></code> as the compressor.</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="bulkwrite-error-handling-inside-transactions">
<h4><code class="docutils literal"><span class="pre">bulkWrite()</span></code> Error Handling inside Transactions<a class="headerlink" href="#bulkwrite-error-handling-inside-transactions" title="Permalink to this headline">¶</a></h4>
<p>Starting in MongoDB 4.2, if a <a class="reference internal" href="../reference/method/db.collection.bulkWrite.html#db.collection.bulkWrite" title="db.collection.bulkWrite()"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">db.collection.bulkWrite()</span></code></a>
operation encounters an error inside a <a class="reference internal" href="../core/transactions.html"><span class="doc">transaction</span></a>, the method throws a <a class="reference internal" href="../reference/method/db.collection.bulkWrite.html#bulkwrite-error-handling"><span class="std std-ref">BulkWriteException</span></a> (same as outside a transaction).</p>
<p>In 4.0, if the <code class="docutils literal"><span class="pre">bulkWrite</span></code> operation encounters an error inside a
transaction, the error thrown is not wrapped as a
<code class="docutils literal"><span class="pre">BulkWriteException</span></code>.</p>
<p>Inside a transaction, the first error in a bulk write causes the
entire bulk write to fail and aborts the transaction, even if the
bulk write is unordered.</p>
</div>
</div>
<div class="section" id="query-plan-improvements">
<span id="query-plans"></span><h3>Query Plan Improvements<a class="headerlink" href="#query-plan-improvements" title="Permalink to this headline">¶</a></h3>
<div class="section" id="plan-cache-states">
<h4>Plan Cache States<a class="headerlink" href="#plan-cache-states" title="Permalink to this headline">¶</a></h4>
<p>Starting in MongoDB 4.2, the cache entry is associated with a state:</p>
<ul class="simple">
<li><a class="reference internal" href="../core/query-plans.html#cache-entry-missing"><span class="std std-ref">Missing</span></a></li>
<li><a class="reference internal" href="../core/query-plans.html#cache-entry-inactive"><span class="std std-ref">Inactive</span></a></li>
<li><a class="reference internal" href="../core/query-plans.html#cache-entry-active"><span class="std std-ref">Active</span></a></li>
</ul>
<p>Associating states with entries helps reduce the likelihood that
sub-optimal cache entries remain in the cache. For more information,
see <a class="reference internal" href="../core/query-plans.html"><span class="doc">Query Plans</span></a>.</p>
</div>
<div class="section" id="queryhash-and-plancachekey">
<h4><code class="docutils literal"><span class="pre">queryHash</span></code> and <code class="docutils literal"><span class="pre">planCacheKey</span></code><a class="headerlink" href="#queryhash-and-plancachekey" title="Permalink to this headline">¶</a></h4>
<ul>
<li><dl class="docutils" id="query-hash">
<dt><code class="docutils literal"><span class="pre">queryHash</span></code></dt>
<dd><p class="first">To help identify slow queries with the same <a class="reference internal" href="../reference/glossary.html#term-query-shape"><span class="xref std std-term">query shape</span></a>,
starting in MongoDB 4.2, each <a class="reference internal" href="../reference/glossary.html#term-query-shape"><span class="xref std std-term">query shape</span></a> is associated with
a <a class="reference internal" href="#query-hash"><span class="std std-ref">queryHash</span></a>. The <code class="docutils literal"><span class="pre">queryHash</span></code> is a
hexadecimal string that represents a hash of the query shape and
is dependent only on the query shape.</p>
<div class="last admonition note">
<p class="first admonition-title">Note</p>
<p class="last">As with any hash function, two different query shapes may result
in the same hash value. However, the occurrence of hash
collisions between different query shapes is unlikely.</p>
</div>
</dd>
</dl>
</li>
<li><dl class="docutils" id="plan-cache-key">
<dt><code class="docutils literal"><span class="pre">planCacheKey</span></code></dt>
<dd><p class="first">To provide more insight into the <a class="reference internal" href="../core/query-plans.html"><span class="doc">query plan cache</span></a>, MongoDB 4.2 introduces the <a class="reference internal" href="#plan-cache-key"><span class="std std-ref">planCacheKey</span></a>.</p>
<p><code class="docutils literal"><span class="pre">planCacheKey</span></code> is a hash of the key for the plan cache entry
associated with the query.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Unlike the <code class="docutils literal"><span class="pre">queryHash</span></code>, the <code class="docutils literal"><span class="pre">planCacheKey</span></code> is a function of
both the query shape and the currently available indexes for the
shape. That is, if indexes that can support the query shape are
added/dropped, the <code class="docutils literal"><span class="pre">planCacheKey</span></code> value may change whereas the
<code class="docutils literal"><span class="pre">queryHash</span></code> value would not change.</p>
</div>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="../core/query-plans.html#plan-cache-key"><span class="std std-ref">planCacheKey</span></a></p>
</div>
</dd>
</dl>
</li>
<li><p class="first">The <code class="docutils literal"><span class="pre">queryHash</span></code> and <code class="docutils literal"><span class="pre">planCacheKey</span></code> are available in:</p>
<ul class="simple">
<li><a class="reference internal" href="../tutorial/manage-the-database-profiler.html"><span class="doc">profiler entry</span></a>
fields <a class="reference internal" href="../reference/database-profiler.html#system.profile.queryHash" title="system.profile.queryHash"><code class="xref mongodb mongodb-data docutils literal"><span class="pre">queryHash</span></code></a> and
<a class="reference internal" href="../reference/database-profiler.html#system.profile.planCacheKey" title="system.profile.planCacheKey"><code class="xref mongodb mongodb-data docutils literal"><span class="pre">planCacheKey</span></code></a> the logged query operations.</li>
<li><a class="reference internal" href="../reference/log-messages.html#log-message-slow-ops"><span class="std std-ref">diagnostic log messages (i.e. mongod/mongos log
messages)</span></a> for the logged query operations.</li>
<li><a class="reference internal" href="../reference/explain-results.html"><span class="doc">explain() output</span></a> fields:
<a class="reference internal" href="../reference/explain-results.html#explain.queryPlanner.queryHash" title="explain.queryPlanner.queryHash"><code class="xref mongodb mongodb-data docutils literal"><span class="pre">queryHash</span></code></a> and
<a class="reference internal" href="../reference/explain-results.html#explain.queryPlanner.planCacheKey" title="explain.queryPlanner.planCacheKey"><code class="xref mongodb mongodb-data docutils literal"><span class="pre">planCacheKey</span></code></a></li>
</ul>
</li>
</ul>
<p>The fields are also available in operations that return information
about the query plan cache:</p>
<ul class="simple">
<li><a class="reference internal" href="../reference/operator/aggregation/planCacheStats.html#pipe._S_planCacheStats" title="$planCacheStats"><code class="xref mongodb mongodb-pipeline docutils literal"><span class="pre">$planCacheStats</span></code></a> aggregation stage (<em>New in MongoDB 4.2</em>)</li>
<li><a class="reference internal" href="../reference/method/PlanCache.listQueryShapes.html#PlanCache.listQueryShapes" title="PlanCache.listQueryShapes()"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">PlanCache.listQueryShapes()</span></code></a>
method/<a class="reference internal" href="../reference/command/planCacheListQueryShapes.html#dbcmd.planCacheListQueryShapes" title="planCacheListQueryShapes"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">planCacheListQueryShapes</span></code></a> command (<em>Deprecated in MongoDB 4.2</em>)</li>
<li><a class="reference internal" href="../reference/method/PlanCache.getPlansByQuery.html#PlanCache.getPlansByQuery" title="PlanCache.getPlansByQuery()"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">PlanCache.getPlansByQuery()</span></code></a>
method/<a class="reference internal" href="../reference/command/planCacheListPlans.html#dbcmd.planCacheListPlans" title="planCacheListPlans"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">planCacheListPlans</span></code></a> command (<em>Deprecated in MongoDB 4.2</em>)</li>
</ul>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="4.2-compatibility.html#deprecated-plan-cache"><span class="std std-ref">Deprecated Plan Cache Commands/Methods</span></a></p>
</div>
</div>
<div class="section" id="regex-and-not">
<h4><code class="docutils literal"><span class="pre">$regex</span></code> and <code class="docutils literal"><span class="pre">$not</span></code><a class="headerlink" href="#regex-and-not" title="Permalink to this headline">¶</a></h4>
<p>Starting in MongoDB 4.2 (and 4.0.7), <a class="reference internal" href="../reference/operator/query/not.html#op._S_not" title="$not"><code class="xref mongodb mongodb-query docutils literal"><span class="pre">$not</span></code></a> operator can perform logical
<code class="docutils literal"><span class="pre">NOT</span></code> operation on <a class="reference internal" href="../reference/operator/query/regex.html#op._S_regex" title="$regex"><code class="xref mongodb mongodb-query docutils literal"><span class="pre">$regex</span></code></a> operator expressions as well as
on regular expression objects (i.e. <code class="docutils literal"><span class="pre">/pattern/</span></code>).</p>
<p>In 4.0 and earlier versions, you could use <a class="reference internal" href="../reference/operator/query/not.html#op._S_not" title="$not"><code class="xref mongodb mongodb-query docutils literal"><span class="pre">$not</span></code></a> operator with
regular expression objects (i.e. <code class="docutils literal"><span class="pre">/pattern/</span></code>) but not with
<a class="reference internal" href="../reference/operator/query/regex.html#op._S_regex" title="$regex"><code class="xref mongodb mongodb-query docutils literal"><span class="pre">$regex</span></code></a> operator expressions.</p>
</div>
<div class="section" id="kill-own-cursors">
<h4>Kill Own Cursors<a class="headerlink" href="#kill-own-cursors" title="Permalink to this headline">¶</a></h4>
<p>Starting in MongoDB 4.2, users can always kill their own cursors,
regardless of whether the users have the privilege to
<a class="reference internal" href="../reference/privilege-actions.html#killCursors" title="killCursors"><code class="xref mongodb mongodb-authaction docutils literal"><span class="pre">killCursors</span></code></a>. As such, the <a class="reference internal" href="../reference/privilege-actions.html#killCursors" title="killCursors"><code class="xref mongodb mongodb-authaction docutils literal"><span class="pre">killCursors</span></code></a>
privilege has no effect starting in MongoDB 4.2.</p>
<p>In MongoDB 4.0, users required the <a class="reference internal" href="../reference/privilege-actions.html#killCursors" title="killCursors"><code class="xref mongodb mongodb-authaction docutils literal"><span class="pre">killCursors</span></code></a> privilege
in order to kill their own cursors.</p>
</div>
<div class="section" id="new-parameters">
<h4>New Parameters<a class="headerlink" href="#new-parameters" title="Permalink to this headline">¶</a></h4>
<p>MongoDB 4.2 adds the parameter <a class="reference internal" href="../reference/parameters.html#param.replBatchLimitBytes" title="replBatchLimitBytes"><code class="xref mongodb mongodb-parameter docutils literal"><span class="pre">replBatchLimitBytes</span></code></a> to
configure the maximum oplog application batch size. The parameter is
also available starting in MongoDB 4.0.10.</p>
</div>
<div class="section" id="retryable-writes-on-certain-single-document-upserts">
<h4>Retryable Writes on Certain Single-Document Upserts<a class="headerlink" href="#retryable-writes-on-certain-single-document-upserts" title="Permalink to this headline">¶</a></h4>
<p>MongoDB 4.2 will retry certain single-document upserts
(update with <code class="docutils literal"><span class="pre">upsert:</span> <span class="pre">true</span></code> and <code class="docutils literal"><span class="pre">multi:</span> <span class="pre">false</span></code>) that encounter a
duplicate key exception. See <a class="reference internal" href="../core/retryable-writes.html#retryable-update-upsert"><span class="std std-ref">Duplicate Key Errors on Upsert</span></a> for
conditions.</p>
<p>Prior to MongoDB 4.2, MongoDB would not retry upsert operations
that encountered a duplicate key error.</p>
</div>
<div class="section" id="db-dropdatabase-and-write-concern">
<h4><code class="docutils literal"><span class="pre">db.dropDatabase()</span></code> and Write Concern<a class="headerlink" href="#db-dropdatabase-and-write-concern" title="Permalink to this headline">¶</a></h4>
<p>Starting in MongODB 4.2, the <a class="reference internal" href="../reference/program/mongo.html#bin.mongo" title="bin.mongo"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongo</span></code></a> shell method
<a class="reference internal" href="../reference/method/db.dropDatabase.html#db.dropDatabase" title="db.dropDatabase()"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">db.dropDatabase()</span></code></a> can take an optional write concern document.</p>
</div>
<div class="section" id="dropconnections">
<h4><code class="docutils literal"><span class="pre">dropConnections</span></code><a class="headerlink" href="#dropconnections" title="Permalink to this headline">¶</a></h4>
<p>The <a class="reference internal" href="../reference/command/dropConnections.html#dbcmd.dropConnections" title="dropConnections"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">dropConnections</span></code></a> command drops the
<a class="reference internal" href="../reference/program/mongod.html#bin.mongod" title="bin.mongod"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongod</span></code></a>/<a class="reference internal" href="../reference/program/mongos.html#bin.mongos" title="bin.mongos"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongos</span></code></a> instance’s outgoing
connections to the specified hosts. The <a class="reference internal" href="../reference/command/dropConnections.html#dbcmd.dropConnections" title="dropConnections"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">dropConnections</span></code></a>
must be run  against the <code class="docutils literal"><span class="pre">admin</span></code> database.</p>
</div>
<div class="section" id="client-disconnection">
<h4>Client Disconnection<a class="headerlink" href="#client-disconnection" title="Permalink to this headline">¶</a></h4>
<p>For the following operations, if the issuing client disconnects before
the operation completes, MongoDB marks the following operations for termination
(e.g. <a class="reference internal" href="../reference/command/killOp.html#dbcmd.killOp" title="killOp"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">killOp</span></code></a> on the operation):</p>
<table border="1" class="docutils">
<colgroup>
<col width="33%" />
<col width="33%" />
<col width="33%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Command</th>
<th class="head"><code class="docutils literal"><span class="pre">mongo</span></code> Shell Method</th>
<th class="head">Notes</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><a class="reference internal" href="../reference/command/aggregate.html#dbcmd.aggregate" title="aggregate"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">aggregate</span></code></a></td>
<td><a class="reference internal" href="../reference/method/db.collection.aggregate.html#db.collection.aggregate" title="db.collection.aggregate()"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">db.collection.aggregate()</span></code></a></td>
<td>Behavior only applies if the pipeline does not include <a class="reference internal" href="../reference/operator/aggregation/out.html#pipe._S_out" title="$out"><code class="xref mongodb mongodb-pipeline docutils literal"><span class="pre">$out</span></code></a> and <a class="reference internal" href="../reference/operator/aggregation/merge.html#pipe._S_merge" title="$merge"><code class="xref mongodb mongodb-pipeline docutils literal"><span class="pre">$merge</span></code></a></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="../reference/command/authenticate.html#dbcmd.authenticate" title="authenticate"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">authenticate</span></code></a></td>
<td><a class="reference internal" href="../reference/method/db.auth.html#db.auth" title="db.auth"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">db.auth</span></code></a></td>
<td>&#160;</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="../reference/command/count.html#dbcmd.count" title="count"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">count</span></code></a></td>
<td><div class="first last line-block">
<div class="line"><a class="reference internal" href="../reference/method/db.collection.count.html#db.collection.count" title="db.collection.count"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">db.collection.count</span></code></a></div>
<div class="line"><a class="reference internal" href="../reference/method/db.collection.countDocuments.html#db.collection.countDocuments" title="db.collection.countDocuments"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">db.collection.countDocuments</span></code></a></div>
<div class="line"><a class="reference internal" href="../reference/method/db.collection.estimatedDocumentCount.html#db.collection.estimatedDocumentCount" title="db.collection.estimatedDocumentCount"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">db.collection.estimatedDocumentCount</span></code></a></div>
</div>
</td>
<td>&#160;</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="../reference/command/distinct.html#dbcmd.distinct" title="distinct"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">distinct</span></code></a></td>
<td><a class="reference internal" href="../reference/method/db.collection.distinct.html#db.collection.distinct" title="db.collection.distinct"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">db.collection.distinct</span></code></a></td>
<td>&#160;</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="../reference/command/find.html#dbcmd.find" title="find"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">find</span></code></a></td>
<td><div class="first last line-block">
<div class="line"><a class="reference internal" href="../reference/method/db.collection.find.html#db.collection.find" title="db.collection.find"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">db.collection.find</span></code></a></div>
<div class="line"><a class="reference internal" href="../reference/method/db.collection.findOne.html#db.collection.findOne" title="db.collection.findOne"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">db.collection.findOne</span></code></a></div>
</div>
</td>
<td>&#160;</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="../reference/command/getnonce.html#dbcmd.getnonce" title="getnonce"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">getnonce</span></code></a></td>
<td>&#160;</td>
<td>&#160;</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="../reference/command/isMaster.html#dbcmd.isMaster" title="isMaster"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">isMaster</span></code></a></td>
<td>&#160;</td>
<td>&#160;</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="../reference/command/listCollections.html#dbcmd.listCollections" title="listCollections"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">listCollections</span></code></a></td>
<td><div class="first last line-block">
<div class="line"><a class="reference internal" href="../reference/method/db.getCollectionInfos.html#db.getCollectionInfos" title="db.getCollectionInfos"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">db.getCollectionInfos</span></code></a></div>
<div class="line"><a class="reference internal" href="../reference/method/db.getCollectionNames.html#db.getCollectionNames" title="db.getCollectionNames"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">db.getCollectionNames</span></code></a></div>
</div>
</td>
<td>&#160;</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="../reference/command/listDatabases.html#dbcmd.listDatabases" title="listDatabases"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">listDatabases</span></code></a></td>
<td>&#160;</td>
<td>&#160;</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="../reference/command/listIndexes.html#dbcmd.listIndexes" title="listIndexes"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">listIndexes</span></code></a></td>
<td><a class="reference internal" href="../reference/method/db.collection.getIndexes.html#db.collection.getIndexes" title="db.collection.getIndexes"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">db.collection.getIndexes</span></code></a></td>
<td>&#160;</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="startup-warnings">
<h4>Startup Warnings<a class="headerlink" href="#startup-warnings" title="Permalink to this headline">¶</a></h4>
<div class="section" id="in-memory-storage-engines">
<h5>In-Memory Storage Engines<a class="headerlink" href="#in-memory-storage-engines" title="Permalink to this headline">¶</a></h5>
<p>Starting in version 4.2 (and 4.0.13 and 3.6.14 ), if a replica set
member uses the <a class="reference internal" href="../core/inmemory.html"><span class="doc">in-memory storage engine</span></a>
(voting or non-voting) but the replica set has
<a class="reference internal" href="../reference/replica-configuration.html#rsconf.writeConcernMajorityJournalDefault" title="writeConcernMajorityJournalDefault"><code class="xref mongodb mongodb-rsconf docutils literal"><span class="pre">writeConcernMajorityJournalDefault</span></code></a> set to true, the
replica set member logs a startup warning.</p>
</div>
<div class="section" id="mongo-shell">
<h5><code class="docutils literal"><span class="pre">mongo</span></code> Shell<a class="headerlink" href="#mongo-shell" title="Permalink to this headline">¶</a></h5>
<p>Starting in MongoDB 4.2 (and 4.0.13), the <a class="reference internal" href="../reference/program/mongo.html#bin.mongo" title="bin.mongo"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongo</span></code></a> shell displays a
warning message when connected to non-genuine MongoDB instances as
these instances may behave differently from the official MongoDB
instances; e.g. missing or incomplete features, different feature
behaviors, etc.</p>
</div>
</div>
<div class="section" id="map-reduce">
<h4>Map-Reduce<a class="headerlink" href="#map-reduce" title="Permalink to this headline">¶</a></h4>
<p>Starting in version 4.2, MongoDB deprecates:</p>
<ul class="simple">
<li>The map-reduce option to <em>create</em> a new sharded collection as well
as the use of the <a class="reference internal" href="../reference/command/mapReduce.html#mapreduce-out-cmd"><span class="std std-ref">sharded</span></a> option for
map-reduce. To output to a sharded collection, create the sharded
collection first. MongoDB 4.2 also deprecates the replacement of
an existing sharded collection.</li>
<li>The explicit specification of <a class="reference internal" href="../reference/command/mapReduce.html#mapreduce-out-cmd"><span class="std std-ref">nonAtomic: false</span></a> option.</li>
</ul>
</div>
<div class="section" id="rollback-time-limit">
<h4>Rollback Time Limit<a class="headerlink" href="#rollback-time-limit" title="Permalink to this headline">¶</a></h4>
<p>Starting in MongoDB 4.2, the rollback time limit is calculated between
the first operation after the common point and the last point in the
oplog for the member to roll back.</p>
<p>In MongoDB 4.0, the rollback time limit is calculated between the
common point and the last point in the oplog for the member to roll
back.</p>
<p>For more information, see <a class="reference internal" href="../core/replica-set-rollbacks.html#rollback-time-limit"><span class="std std-ref">Rollback Elapsed Time Limitations</span></a>.</p>
</div>
<div class="section" id="isinteractive">
<h4><code class="docutils literal"><span class="pre">isInteractive()</span></code><a class="headerlink" href="#isinteractive" title="Permalink to this headline">¶</a></h4>
<p>MongoDB 4.2 adds a new <a class="reference internal" href="../reference/program/mongo.html#bin.mongo" title="bin.mongo"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongo</span></code></a> shell method
<a class="reference internal" href="../reference/method/isInteractive.html#isInteractive" title="isInteractive()"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">isInteractive()</span></code></a> that returns a boolean indicating whether the
<a class="reference internal" href="../reference/program/mongo.html#bin.mongo" title="bin.mongo"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongo</span></code></a> shell is running in interactive or script mode.</p>
</div>
<div class="section" id="change-to-explain-output">
<h4>Change to <code class="docutils literal"><span class="pre">explain</span></code> Output<a class="headerlink" href="#change-to-explain-output" title="Permalink to this headline">¶</a></h4>
<p>Starting in MongoDB 4.2, the <code class="docutils literal"><span class="pre">explain</span></code> output can include a new
<a class="reference internal" href="../reference/explain-results.html#explain.queryPlanner.optimizedPipeline" title="explain.queryPlanner.optimizedPipeline"><code class="xref mongodb mongodb-data docutils literal"><span class="pre">optimizedPipeline</span></code></a> field. For details,
refer to <a class="reference internal" href="../reference/explain-results.html#explain.queryPlanner.optimizedPipeline" title="explain.queryPlanner.optimizedPipeline"><code class="xref mongodb mongodb-data docutils literal"><span class="pre">optimizedPipeline</span></code></a>.</p>
</div>
<div class="section" id="change-to-ismaster-output">
<h4>Change to <code class="docutils literal"><span class="pre">isMaster</span></code> Output<a class="headerlink" href="#change-to-ismaster-output" title="Permalink to this headline">¶</a></h4>
<p>Starting in MongoDB 4.2, the output for <a class="reference internal" href="../reference/command/isMaster.html#dbcmd.isMaster" title="isMaster"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">isMaster</span></code></a>, and the
<a class="reference internal" href="../reference/method/db.isMaster.html#db.isMaster" title="db.isMaster()"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">db.isMaster()</span></code></a> helper method, returns the
<a class="reference internal" href="../reference/command/isMaster.html#isMaster.connectionId" title="isMaster.connectionId"><code class="xref mongodb mongodb-data docutils literal"><span class="pre">connectionId</span></code></a> for the
<a class="reference internal" href="../reference/program/mongod.html#bin.mongod" title="bin.mongod"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongod</span></code></a>/<a class="reference internal" href="../reference/program/mongos.html#bin.mongos" title="bin.mongos"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongos</span></code></a> instance’s connection to
the client.</p>
</div>
</div>
<div class="section" id="optimized-index-builds">
<span id="index-builds"></span><h3>Optimized Index Builds<a class="headerlink" href="#optimized-index-builds" title="Permalink to this headline">¶</a></h3>
<p>MongoDB index builds against a populated collection require an exclusive
read-write lock against the collection. Operations that require a read
or write lock on the collection must wait until the
<a class="reference internal" href="../reference/program/mongod.html#bin.mongod" title="bin.mongod"><code class="xref mongodb mongodb-binary docutils literal"><span class="pre">mongod</span></code></a> releases the lock. MongoDB uses an optimized build
process that only holds the  exclusive lock at the beginning and end of
the index build. The rest of the build process yields to interleaving
read and write operations.</p>
<p>For <a class="reference internal" href="../reference/command/setFeatureCompatibilityVersion.html#view-fcv"><span class="std std-ref">feature compatibility version (fcv)</span></a> <code class="docutils literal"><span class="pre">4.2</span></code>,
MongoDB 4.2 index builds fully replace the index build processes
supported in previous MongoDB versions. MongoDB ignores the
<code class="docutils literal"><span class="pre">background</span></code> index build option if specified to
<a class="reference internal" href="../reference/command/createIndexes.html#dbcmd.createIndexes" title="createIndexes"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">createIndexes</span></code></a> or its shell helpers
<a class="reference internal" href="../reference/method/db.collection.createIndex.html#db.collection.createIndex" title="db.collection.createIndex()"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">createIndex()</span></code></a> and
<a class="reference internal" href="../reference/method/db.collection.createIndexes.html#db.collection.createIndexes" title="db.collection.createIndexes()"><code class="xref mongodb mongodb-method docutils literal"><span class="pre">createIndexes()</span></code></a>.</p>
<div class="note admonition">
<p class="first admonition-title">Requires featureCompatibilityVersion 4.2</p>
<p>For MongoDB clusters upgraded from 4.0 to 4.2, you must set the
<a class="reference internal" href="../reference/command/setFeatureCompatibilityVersion.html#view-fcv"><span class="std std-ref">feature compatibility version (fcv)</span></a> to <code class="docutils literal"><span class="pre">4.2</span></code>
to enable the optimized build process. For more information on
setting the fCV, see <a class="reference internal" href="../reference/command/setFeatureCompatibilityVersion.html#dbcmd.setFeatureCompatibilityVersion" title="setFeatureCompatibilityVersion"><code class="xref mongodb mongodb-dbcommand docutils literal"><span class="pre">setFeatureCompatibilityVersion</span></code></a>.</p>
<p class="last">MongoDB 4.2 clusters running with fCV <code class="docutils literal"><span class="pre">4.0</span></code> only support 4.0 index
builds.</p>
</div>
<p>For complete documentation on the index build process, see
<a class="reference internal" href="../core/index-creation.html#index-operations"><span class="std std-ref">Index Builds on Populated Collections</span></a>.</p>
</div>
<div class="section" id="changes-affecting-compatibility">
<h3>Changes Affecting Compatibility<a class="headerlink" href="#changes-affecting-compatibility" title="Permalink to this headline">¶</a></h3>
<p>Some changes can affect compatibility and may require user actions. For
a detailed list of compatibility changes, see
<a class="reference internal" href="4.2-compatibility.html"><span class="doc">Compatibility Changes in MongoDB 4.2</span></a>.</p>
</div>
<div class="section" id="upgrade-procedures">
<span id="upgrade"></span><h3>Upgrade Procedures<a class="headerlink" href="#upgrade-procedures" title="Permalink to this headline">¶</a></h3>
<div class="admonition-feature-compatibility-version admonition">
<p class="first admonition-title">Feature Compatibility Version</p>
<p>To upgrade, the 4.0 instances must have
<code class="docutils literal"><span class="pre">featureCompatibilityVersion</span></code> set to <code class="docutils literal"><span class="pre">4.0</span></code>. To check the version:</p>
<div class="button-code-block">
<div class="button-row">
<a class="code-button--copy code-button" role="button">
copy</a>
</div>
<div class="copyable-code-block highlight-javascript"><div class="highlight"><pre><span></span><span class="nx">db</span><span class="p">.</span><span class="nx">adminCommand</span><span class="p">(</span> <span class="p">{</span> <span class="nx">getParameter</span><span class="o">:</span> <span class="mi">1</span><span class="p">,</span> <span class="nx">featureCompatibilityVersion</span><span class="o">:</span> <span class="mi">1</span> <span class="p">}</span> <span class="p">)</span>
</pre></div>
</div>
</div>
<p>For specific details on verifying and setting the
<code class="docutils literal"><span class="pre">featureCompatibilityVersion</span></code> as well as information on other
prerequisites/considerations for upgrades, refer to the individual
upgrade instructions:</p>
<ul class="last simple">
<li><a class="reference internal" href="4.2-upgrade-standalone.html"><span class="doc">Upgrade a Standalone to 4.2</span></a></li>
<li><a class="reference internal" href="4.2-upgrade-replica-set.html"><span class="doc">Upgrade a Replica Set to 4.2</span></a></li>
<li><a class="reference internal" href="4.2-upgrade-sharded-cluster.html"><span class="doc">Upgrade a Sharded Cluster to 4.2</span></a></li>
</ul>
</div>
<p>If you need guidance on upgrading to 4.2, <a class="reference external" href="https://www.mongodb.com/products/consulting?jmp=docs">MongoDB offers major version
upgrade services</a>
to help ensure a smooth transition without interruption to your MongoDB application.</p>
</div>
<div class="section" id="download">
<h3>Download<a class="headerlink" href="#download" title="Permalink to this headline">¶</a></h3>
<p>To download MongoDB 4.2, go to the <a class="reference external" href="https://www.mongodb.com/download-center/community?jmp=docs">MongoDB Download Center</a></p>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<ul class="last simple">
<li><a class="reference external" href="https://github.com/mongodb/mongo/blob/v4.2/distsrc/THIRD-PARTY-NOTICES">All Third Party License Notices</a>.</li>
</ul>
</div>
</div>
<div class="section" id="known-issues">
<span id="id10"></span><h3>Known Issues<a class="headerlink" href="#known-issues" title="Permalink to this headline">¶</a></h3>
<table border="1" class="colwidths-given docutils">
<colgroup>
<col width="14%" />
<col width="67%" />
<col width="19%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">In Version</th>
<th class="head">Issues</th>
<th class="head">Status</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>4.2.0</td>
<td><a class="reference external" href="https://jira.mongodb.org/browse/SERVER-43075">SERVER-43075</a>: Missing <a class="reference internal" href="../reference/configuration-options.html#storage.journal.commitIntervalMs" title="storage.journal.commitIntervalMs"><code class="xref mongodb mongodb-setting docutils literal"><span class="pre">storage.journal.commitIntervalMs</span></code></a></td>
<td>Fixed in 4.2.1</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="report-an-issue">
<h3>Report an Issue<a class="headerlink" href="#report-an-issue" title="Permalink to this headline">¶</a></h3>
<p>To report an issue, see
<a class="reference external" href="https://github.com/mongodb/mongo/wiki/Submit-Bug-Reports">https://github.com/mongodb/mongo/wiki/Submit-Bug-Reports</a> for
instructions on how to file a JIRA ticket for the MongoDB server or one
of the related projects.</p>
<div class="toctree-wrapper compound">
</div>
</div>
</div>
</div>

                
    <div id="btnv">
      <span class="btn-arrow-left">&larr; &nbsp;</span>
      <a class="btn-prev-text" href="../release-notes.html" title="Previous Section: Release Notes"><span>Release Notes</span></a>
      <a class="btn-next-text" href="4.2-compatibility.html" title="Next Section: Compatibility Changes in MongoDB 4.2"><span>Compatibility Changes in MongoDB 4.2</span></a>
      <span class="btn-arrow-right">&nbsp;&rarr;</span>
    </div>
                  <div class="footer">
                    <div class="copyright">
                      <p>&copy; MongoDB, Inc 2008-present. MongoDB, Mongo, and the leaf logo are registered trademarks of MongoDB, Inc.</p>
                    </div>
                  </div>
              </div></div>
            </div>
        </div>
    </div>
    <div class="right-column">
      <div class="wrapper"> <div id='mongodb-docs-1'>
   <script type='text/javascript'>
      googletag.cmd.push(function() { googletag.display('mongodb-docs-1'); });
   </script>
</div>
            <div class="social">
               <a class="slack-icon" href="https://slackpass.io/mongo-db?jmp=docs" title="https://slackpass.io/mongo-db?jmp=docs"><i class="fab fa-slack" aria-hidden="true"></i></a>
               <a class="twitter-icon" href="https://twitter.com/MongoDB" title="https://twitter.com/MongoDB"><i class="fab fa-twitter-square"></i></a>
               <a class="youtube-icon" href="https://www.youtube.com/user/MongoDB" title="https://www.youtube.com/user/MongoDB"><i class="fab fa-youtube-square"></i></a>
               <a class="facebook-icon" href="https://www.facebook.com/mongodb" title="https://www.facebook.com/mongodb"><i class="fab fa-facebook-square"></i></a>
               <a class="stack-overflow-icon" href="https://stackoverflow.com/tags/mongodb/info" title="https://stackoverflow.com/tags/mongodb/info"><i class="fab fa-stack-overflow" aria-hidden="true"></i></a>
            </div>
        

      </div>
    </div>
    
      <div id="rating-panel"></div>
    
    <div class="clearfix"></div>
  </div>
  

  <script type="text/javascript">
  // Bootstrap array of links that should trigger a full page reload
  window.docsExcludedNav = ['/administration', '/administration/production-checklist', '/administration/indexes-management', '/aggregation', '/applications/geospatial-indexes', '/applications/indexes', '/contributors/getting-started', '/core/2d', '/core/2dsphere', '/core/auditing', '/core/authentication', '/core/authorization', '/core/backups', '/core/read-isolation-consistency-recency', '/core/databases-and-collections', '/core/geohaystack', '/core/index-single', '/core/index-compound', '/core/index-creation', '/core/index-hashed', '/core/index-multikey', '/core/index-partial', '/core/index-sparse', '/core/index-text', '/core/index-ttl', '/core/index-unique', '/core/index-wildcard', '/core/journaling', '/core/kerberos', '/core/map-reduce', '/core/operational-segregation', '/core/query-optimization', '/core/read-preference', '/core/replica-set-architectures', '/core/replica-set-high-availability', '/core/replica-set-members', '/core/replica-set-secondary', '/core/transactions', '/geospatial-queries', '/replication', '/core/sharded-cluster-components', '/core/wiredtiger', '/core/write-operations-atomicity', '/crud', '/indexes', '/installation', '/introduction', '/mongo', '/products/bi-connector', '/reference/command', '/reference/collation', '/text-search', '/tutorial/manage-the-database-profiler', '/core/index-text', '/reference/bson-types', '/reference/configuration-options', '/reference/indexes', '/reference/method', '/reference/operator/aggregation', '/reference/operator/query', '/reference/operator/query-modifier', '/reference/operator/update', '/reference/replication', '/reference/read-concern', '/reference/security', '/reference/sharding', '/reference/write-concern', '/release-notes/2.4', '/release-notes/2.6', '/release-notes/2.8', '/release-notes/3.0', '/release-notes/3.2', '/release-notes/3.4', '/release-notes/3.6', '/release-notes/4.0', '/release-notes/4.2', '/security', '/sharding', '/changeStreams', '/core/zone-sharding', '/core/hashed-sharding', '/core/ranged-sharding', '/storage', '/tutorial/change-sharded-cluster-wiredtiger', '/tutorial/insert-documents', '/tutorial/query-documents', '/tutorial/remove-documents', '/tutorial/update-documents', '/tutorial/enable-authentication', '/tutorial/install-mongodb-on-ubuntu', '/tutorial/install-mongodb-on-windows', '/tutorial/install-mongodb-on-red-hat', '/tutorial/install-mongodb-on-debian', '/tutorial/install-mongodb-on-suse', '/tutorial/install-mongodb-on-amazon', '/tutorial/install-mongodb-enterprise-on-ubuntu', '/tutorial/install-mongodb-enterprise-on-windows', '/tutorial/install-mongodb-enterprise-on-red-hat', '/tutorial/install-mongodb-enterprise-on-debian', '/tutorial/install-mongodb-enterprise-on-suse', '/tutorial/install-mongodb-enterprise-on-amazon', '/tutorial/install-mongodb-on-os-x'];
  </script></body>
</html>